MCPcopy Index your code
hub / github.com/go-task/task / GetTaskEnvInt

Function GetTaskEnvInt

internal/env/env.go:80–87  ·  view source on GitHub ↗

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

(key string)

Source from the content-addressed store, hash-verified

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.
80func GetTaskEnvInt(key string) (int, bool) {
81 v := GetTaskEnv(key)
82 if v == "" {
83 return 0, false
84 }
85 i, err := strconv.Atoi(v)
86 return i, err == nil
87}
88
89// GetTaskEnvDuration returns the duration value of a TASK_ prefixed env var.
90// 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…