MCPcopy
hub / github.com/go-task/task / GetTaskEnvBool

Function GetTaskEnvBool

internal/env/env.go:69–76  ·  view source on GitHub ↗

GetTaskEnvBool returns the boolean value of a TASK_ prefixed env var. Returns the value and true if set and valid, or false and false if not set or invalid.

(key string)

Source from the content-addressed store, hash-verified

67// GetTaskEnvBool returns the boolean value of a TASK_ prefixed env var.
68// Returns the value and true if set and valid, or false and false if not set or invalid.
69func GetTaskEnvBool(key string) (bool, bool) {
70 v := GetTaskEnv(key)
71 if v == "" {
72 return false, false
73 }
74 b, err := strconv.ParseBool(v)
75 return b, err == nil
76}
77
78// GetTaskEnvInt returns the integer value of a TASK_ prefixed env var.
79// Returns the value and true if set and valid, or 0 and false if not set or invalid.

Callers 1

getEnvAsFunction · 0.92

Calls 1

GetTaskEnvFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…