Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import (
"flag"
"fmt"
)
func main() {
var version string
flag.StringVar(&version, "setVersion", "1.0.0", "") // parse the value of the flag setVersion to variable version
flag.Parse()
fmt.Println("version = ", version)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment