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

Function GetTaskEnvDuration

internal/env/env.go:91–98  ·  view source on GitHub ↗

GetTaskEnvDuration returns the duration 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

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.
91func GetTaskEnvDuration(key string) (time.Duration, bool) {
92 v := GetTaskEnv(key)
93 if v == "" {
94 return 0, false
95 }
96 d, err := time.ParseDuration(v)
97 return d, err == nil
98}
99
100// GetTaskEnvString returns the string value of a TASK_ prefixed env var.
101// Returns the value and true if set (non-empty), or empty string and false if not set.

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…