mirror of
https://github.com/jimeh/go-golden.git
synced 2026-02-19 03:16:38 +00:00
21 lines
412 B
Go
21 lines
412 B
Go
package golden
|
|
|
|
import "os"
|
|
|
|
var truthyStrings = []string{"1", "y", "t", "yes", "on", "true"}
|
|
|
|
type UpdatingFunc func() bool
|
|
|
|
// EnvVarUpdateFunc checks if the GOLDEN_UPDATE environment variable is set to
|
|
// one of "1", "y", "t", "yes", "on", or "true".
|
|
func EnvVarUpdatingFunc() bool {
|
|
env := os.Getenv("GOLDEN_UPDATE")
|
|
for _, v := range truthyStrings {
|
|
if env == v {
|
|
return true
|
|
}
|
|
}
|
|
|
|
return false
|
|
}
|