Skip to content

Commit

Permalink
Fixup sysfs/system_cpu.go lint errors
Browse files Browse the repository at this point in the history
Remove unnecessary nil assignment in `sysfs/system_cpu.go` to fix linter
errors.

Followup to #627

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ committed May 13, 2024
1 parent 51f7d13 commit d1b7969
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit d1b7969

Please sign in to comment.