https://github.com/terrastruct/terrastruct-backend/pull/975/files#diff-1b00307a7a2bd1ffc68527a7df7c9c83327d8cd2dd00f4741ec6bd0b96605cd4
27 lines
441 B
Go
27 lines
441 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") != ""
|
|
}
|