(s string, base, bitSize int)
| 109 | } |
| 110 | |
| 111 | func parseUint(s string, base, bitSize int) (uint64, error) { |
| 112 | v, err := strconv.ParseUint(s, base, bitSize) |
| 113 | if err != nil { |
| 114 | intValue, intErr := strconv.ParseInt(s, base, bitSize) |
| 115 | // 1. Handle negative values greater than MinInt64 (and) |
| 116 | // 2. Handle negative values lesser than MinInt64 |
| 117 | if intErr == nil && intValue < 0 { |
| 118 | return 0, nil |
| 119 | } else if intErr != nil && |
| 120 | intErr.(*strconv.NumError).Err == strconv.ErrRange && |
| 121 | intValue < 0 { |
| 122 | return 0, nil |
| 123 | } |
| 124 | return 0, err |
| 125 | } |
| 126 | return v, nil |
| 127 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…