d2/lib/env/env.go
Alexander Wang 524c089a74 oss
Co-authored-by: Anmol Sethi <hi@nhooyr.io>
2022-11-03 06:54:49 -07:00

27 lines
443 B
Go

package env
import (
"os"
)
func Test() bool {
return os.Getenv("TEST_MODE") != ""
}
func Dev() bool {
return os.Getenv("DEV_MODE") != ""
}
func Debug() bool {
return os.Getenv("DEBUG") != ""
}
// People have DEV_MODE on while running tests. If that's the case, this
// function will return false.
func DevOnly() bool {
return Dev() && !Test()
}
func SkipGraphDiffTests() bool {
return os.Getenv("SKIP_GRAPH_DIFF_TESTS") == "on"
}