That is because even though you use _
to mask github.com/hashicorp/vault/builtin/credential/aws
, the import auctually happened. And the package imported testing
, which generate all these flags.
You can get rid of the testing
flags by using a new FlagSet.
func main() {
f:=flag.NewFlagSet("Your app name",flag.ExitOnError)
f.StringVar(
&myFlag, "myFlag", "", "Test flag",
)
f.Parse(os.Args)
f.Usage()
}
Playground: https://play.golang.org/p/O8ibPn77L46