Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup sysfs/system_cpu.go lint errors #638

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sysfs/system_cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func parseCpufreqCpuinfo(cpuPath string) (*SystemCPUCpufreqStats, error) {
}

// "total_trans" is the total number of times the CPU has changed frequency.
var cpuinfoFrequencyTransitionsTotal *uint64 = nil
var cpuinfoFrequencyTransitionsTotal *uint64
cpuinfoFrequencyTransitionsTotalUint, err := util.ReadUintFromFile(filepath.Join(cpuPath, "stats", "total_trans"))
if err != nil {
if !(os.IsNotExist(err) || os.IsPermission(err)) {
Expand All @@ -308,7 +308,7 @@ func parseCpufreqCpuinfo(cpuPath string) (*SystemCPUCpufreqStats, error) {
}

// "time_in_state" is the total time spent at each frequency.
var cpuinfoFrequencyDuration *map[uint64]uint64 = nil
var cpuinfoFrequencyDuration *map[uint64]uint64
cpuinfoFrequencyDurationString, err := util.ReadFileNoStat(filepath.Join(cpuPath, "stats", "time_in_state"))
if err != nil {
if !(os.IsNotExist(err) || os.IsPermission(err)) {
Expand Down Expand Up @@ -337,7 +337,7 @@ func parseCpufreqCpuinfo(cpuPath string) (*SystemCPUCpufreqStats, error) {
}

// "trans_table" contains information about all the CPU frequency transitions.
var cpuinfoTransitionTable *[][]uint64 = nil
var cpuinfoTransitionTable *[][]uint64
cpuinfoTransitionTableString, err := util.ReadFileNoStat(filepath.Join(cpuPath, "stats", "trans_table"))
if err != nil {
if !(os.IsNotExist(err) || os.IsPermission(err)) {
Expand Down