Skip to content

Commit 97c2628

Browse files
Merge pull request #33 from nrfta/bug/fix-is-test
bug: more reliably find out if running in tests
2 parents 0d97b3f + a82027f commit 97c2628

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,12 @@ func unmarshalConfig(config interface{}) error {
8888

8989
func isTesting() bool {
9090
for _, arg := range os.Args {
91-
if strings.HasPrefix(arg, "-test.v=") {
91+
if strings.Contains(arg, "-test") || strings.Contains(arg, ".test") {
9292
return true
9393
}
9494
}
95-
return false || os.Getenv("ENV") == "test"
95+
96+
return os.Getenv("ENV") == "test"
9697
}
9798

9899
func getMetaConfig(config interface{}) *MetaConfig {

0 commit comments

Comments
 (0)