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