Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In "go test" 1.13 and higher, you cannot call parse.Flags in init()
In https://golang.org/doc/go1.13#testing Testing flags are now registered in the new Init function, which is invoked by the generated main function for the test. As a result, testing flags are now only registered when running a test binary, and packages that call flag.Parse during package initialization may cause tests to fail. See: https://groups.google.com/d/msg/golang-nuts/rkCdS1EQwSM/4gbwNh0QAwAJ golang/go#21051 https://go-review.googlesource.com/c/go/+/173722/
- Loading branch information