INNER CODE UNIT · Go
getenvInt
buildpacks-community/kpack · cmd/build-init/main.go:249
func getenvInt(key string, defaultValue int) int {
value := os.Getenv(key)
atoi, err := strconv.Atoi(value)
if err != nil {
return defaultValue
}
return atoi
}
func getenvBool(key string) bool {
value := os.Getenv(key)
b, err := strconv.ParseBool(value)
if err != nil {
return false
}
return b
}