Helper function to parse int, assuming it might be missing in this context For a real scenario, use strconv.Atoi.
(s string)
| 287 | // Helper function to parse int, assuming it might be missing in this context |
| 288 | // For a real scenario, use strconv.Atoi. |
| 289 | func parseInt(s string) (int, error) { |
| 290 | var i int |
| 291 | |
| 292 | n, err := fmt.Sscan(s, &i) |
| 293 | if err != nil || n == 0 { |
| 294 | return 0, fmt.Errorf("failed to parse int: %s", s) |
| 295 | } |
| 296 | |
| 297 | return i, nil |
| 298 | } |
no outgoing calls
no test coverage detected