(value string)
| 230 | } |
| 231 | |
| 232 | func parsePositiveAmount(value string) (int, error) { |
| 233 | amount, err := parseNonNegativeAmount(value) |
| 234 | if err != nil { |
| 235 | return 0, err |
| 236 | } |
| 237 | if amount == 0 { |
| 238 | return 0, fmt.Errorf("amount must be greater than zero") |
| 239 | } |
| 240 | return amount, nil |
| 241 | } |
| 242 | |
| 243 | func parseNonNegativeAmount(value string) (int, error) { |
| 244 | amount, err := strconv.Atoi(value) |
no test coverage detected