MCPcopy Create free account
hub / github.com/prometheus/procfs / SysReadIntFromFile

Function SysReadIntFromFile

internal/util/sysreadfile.go:62–68  ·  view source on GitHub ↗

SysReadIntFromFile reads a file using SysReadFile and attempts to parse a int64 from it.

(path string)

Source from the content-addressed store, hash-verified

60
61// SysReadIntFromFile reads a file using SysReadFile and attempts to parse a int64 from it.
62func 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}

Callers 1

parseClassThermalZoneFunction · 0.92

Calls 1

SysReadFileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…