Skip to content

Commit ae2937e

Browse files
authored
Fixup sysfs/system_cpu.go lint errors (#638)
Remove unnecessary nil assignment in `sysfs/system_cpu.go` to fix linter errors. Followup to #627 Signed-off-by: SuperQ <superq@gmail.com>
1 parent 51f7d13 commit ae2937e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

sysfs/system_cpu.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func parseCpufreqCpuinfo(cpuPath string) (*SystemCPUCpufreqStats, error) {
297297
}
298298

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

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

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

0 commit comments

Comments
 (0)