Skip to content

Commit

Permalink
chore: add IS_GO_TEST
Browse files Browse the repository at this point in the history
Change-Id: If8b912fca32c318f47972a4b424f39ab555f236c
  • Loading branch information
andeya committed Aug 18, 2021
1 parent b50c8d7 commit ed2b3cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ func init() {
isGoTest = checkGoTestEnv()
}

const IS_GO_TEST = "IS_GO_TEST"

func checkGoTestEnv() bool {
for _, arg := range os.Args[1:] {
for _, s := range []string{
Expand All @@ -33,6 +35,7 @@ func checkGoTestEnv() bool {
}
}
}
return false
env := os.Getenv(IS_GO_TEST)
return env == "1" || env == "true"
// return strings.HasSuffix(os.Args[0], ".test")
}

0 comments on commit ed2b3cf

Please sign in to comment.