ReadIntFromFile reads a file and attempts to parse a int64 from it.
(path string)
| 91 | |
| 92 | // ReadIntFromFile reads a file and attempts to parse a int64 from it. |
| 93 | func ReadIntFromFile(path string) (int64, error) { |
| 94 | data, err := os.ReadFile(path) |
| 95 | if err != nil { |
| 96 | return 0, err |
| 97 | } |
| 98 | return strconv.ParseInt(strings.TrimSpace(string(data)), 10, 64) |
| 99 | } |
| 100 | |
| 101 | // ParseBool parses a string into a boolean pointer. |
| 102 | func ParseBool(b string) *bool { |
no outgoing calls
no test coverage detected
searching dependent graphs…