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