// readCgroupFileToInt64 reads contents from given `cgroupPath/cgroupFile` and returns its int64 value
readCgroupFileToInt64 reads contents from given `cgroupPath/cgroupFile` and returns its int64 value
// readCgroupFileToInt64 reads contents from given ` cgroupPath / cgroupFile ` and returns its int64 value
func readCgroupFileToInt64(cgroupPath, cgroupFile string) (int64, error) {
	contents, err := ioutil.ReadFile(filepath.Join(cgroupPath, cgroupFile))
	if err != nil {
		return -1, err
	}
	strValue := strings.TrimSpace(string(contents))
	if value, err := strconv.ParseInt(strValue, 10, 64); err == nil {
		return value, nil
	} else {
		return -1, err
	}
}
func readCgroupFileToInt64 ( cgroupPath , cgroupFile string ) ( int64 , error ) { contents , err := ioutil . ReadFile ( filepath . Join ( cgroupPath , cgroupFile ) ) if err != nil { return - 1 , err } strValue := strings . TrimSpace ( string ( contents ) ) if value , err := strconv . ParseInt ( strValue , 10 , 64 ) ; err == nil { return value , nil } else { return - 1 , err } }
readCgroupFileToInt64 reads contents from given `cgroupPath/cgroupFile` and returns its int64 value
readCgroupFileToInt64 reads contents from given ` cgroupPath / cgroupFile ` and returns its int64 value