I have a small go command line utility that I am building in the usual way:
go build
I use the flag
package to add command line flags. And all was going swimmingly until I started getting a lot of test flags showing up. Now when I print the usage using flag.Usage
I see lots of extra flags:
-test.bench string
regular expression to select benchmarks to run
-test.benchmem
print memory allocations for benchmarks
-test.benchtime duration
approximate run time for each benchmark (default 1s)
-test.blockprofile string
write a goroutine blocking profile to the named file after execution
-test.blockprofilerate int
if >= 0, calls runtime.SetBlockProfileRate() (default 1)
There are a lot more than this.
I am using the main flag set and adding flags with flag.IntVar
and the like.
I can't figure out what I did or how this could have been enabled. None of my other programs include these test flags in the default usage message. I appreciate any pointers.