Safe parsing helpers
(s string)
| 9 | |
| 10 | // Safe parsing helpers |
| 11 | func parseInt(s string) int { |
| 12 | if s == "" { |
| 13 | return 0 |
| 14 | } |
| 15 | i, err := strconv.Atoi(s) |
| 16 | if err != nil { |
| 17 | return 0 |
| 18 | } |
| 19 | return i |
| 20 | } |
| 21 | |
| 22 | func parseFloat32(s string) float32 { |
| 23 | if s == "" { |
no outgoing calls
no test coverage detected