(valStr string, v *IntValidation)
| 88 | } |
| 89 | |
| 90 | func IntFromStr(valStr string, v *IntValidation) (int, error) { |
| 91 | if valStr == "" { |
| 92 | return ValidateIntMissing(v) |
| 93 | } |
| 94 | casted, castOk := s.ParseInt(valStr) |
| 95 | if !castOk { |
| 96 | return 0, ErrorInvalidPrimitiveType(valStr, PrimTypeInt) |
| 97 | } |
| 98 | return ValidateIntProvided(casted, v) |
| 99 | } |
| 100 | |
| 101 | func IntFromEnv(envVarName string, v *IntValidation) (int, error) { |
| 102 | valStr := ReadEnvVar(envVarName) |
no test coverage detected