SysReadIntFromFile reads a file using SysReadFile and attempts to parse a int64 from it.
(path string)
| 60 | |
| 61 | // SysReadIntFromFile reads a file using SysReadFile and attempts to parse a int64 from it. |
| 62 | func SysReadIntFromFile(path string) (int64, error) { |
| 63 | data, err := SysReadFile(path) |
| 64 | if err != nil { |
| 65 | return 0, err |
| 66 | } |
| 67 | return strconv.ParseInt(strings.TrimSpace(string(data)), 10, 64) |
| 68 | } |
no test coverage detected
searching dependent graphs…