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)
| 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. |
| 91 | func 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. |
no test coverage detected
searching dependent graphs…