You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing "testing" in files whose name doesn't end _test.go will cause a lot of test.xxx flags in those go program which have both imported "flag" and "github.com/jmcvetta/neoism".
> ./test
......
Usage of ./test:
-httptest.serve string
if non-empty, httptest.NewServer serves on this address and blocks
-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)
-test.count n
run tests and benchmarks n times (default 1)
......
And I got the "httptest.serve" left even if I removed all the test.go files in neoism.
This is really annoying, so I hope it will be fixed soon.
Thanks for your effort.
ArkBriar
2016-4-29
The text was updated successfully, but these errors were encountered:
Importing the testing package in a file, which is used by the main binary, will pollute the flags package with testing help usage messages. This hinders the usage of the neoism package in a cli application. The file benchmark_test*.go are loading the testing package and are therefore responsible for the flag pollution. To exclude the benchmark_connect helpers one can suffix the files with _test. This will ensure that the benchmark_connect helpers are only loaded during testing and do not pollute the main binary. Another solution would be to introduce a neoism_test package, which would result a massive code reorganization.
co0p
added a commit
to co0p/neoism
that referenced
this issue
Feb 25, 2018
Importing the testing package in a file, which is used by the main binary, will pollute the flags package with testing help usage messages. This hinders the usage of the neoism package in a cli application. The file benchmark_test*.go are loading the testing package and are therefore responsible for the flag pollution. To exclude the benchmark_connect helpers one can suffix the files with _test. This will ensure that the benchmark_connect helpers are only loaded during testing and do not pollute the main binary. Another solution would be to introduce a neoism_test package, which would result a massive code reorganization.
Importing "testing" in files whose name doesn't end _test.go will cause a lot of test.xxx flags in those go program which have both imported "flag" and "github.com/jmcvetta/neoism".
Here is the example:
And I got the "httptest.serve" left even if I removed all the test.go files in neoism.
This is really annoying, so I hope it will be fixed soon.
Thanks for your effort.
ArkBriar
2016-4-29
The text was updated successfully, but these errors were encountered: