InTest reports whether the current binary is a test binary.
()
| 16 | |
| 17 | // InTest reports whether the current binary is a test binary. |
| 18 | func InTest() bool { |
| 19 | return lazyInTest.Get(func() bool { |
| 20 | return flag.Lookup("test.v") != nil |
| 21 | }) |
| 22 | } |
| 23 | |
| 24 | // TB is testing.TB, to avoid importing "testing" in non-test code. |
| 25 | type TB interface { |
no test coverage detected
searching dependent graphs…