(id string, amount string)
| 292 | } |
| 293 | |
| 294 | func parseIDAndAmount(id string, amount string) (int, int, error) { |
| 295 | parsedID, err := strconv.Atoi(id) |
| 296 | if err != nil { |
| 297 | return 0, 0, fmt.Errorf("id must be an integer: %w", err) |
| 298 | } |
| 299 | value, err := parsePositiveAmount(amount) |
| 300 | if err != nil { |
| 301 | return 0, 0, err |
| 302 | } |
| 303 | return parsedID, value, nil |
| 304 | } |
| 305 | |
| 306 | func parsePositiveAmount(value string) (int, error) { |
| 307 | amount, err := strconv.Atoi(value) |
no test coverage detected