code cleanup
This commit is contained in:
@@ -53,6 +53,7 @@ func (r *SysDriver) ReadClockSensors() ([]ClockSensor, error) {
|
||||
|
||||
clockSensors = append(clockSensors, ClockSensor{
|
||||
path: path,
|
||||
number: coreID,
|
||||
Name: fmt.Sprintf("core %d", coreID),
|
||||
FrequencyGHz: khz / 1000000.0, // Convert KHz to GHz
|
||||
})
|
||||
@@ -60,7 +61,7 @@ func (r *SysDriver) ReadClockSensors() ([]ClockSensor, error) {
|
||||
|
||||
// Guarantee numerical order by core ID
|
||||
sort.Slice(clockSensors, func(i, j int) bool {
|
||||
return clockSensors[i].Name < clockSensors[j].Name
|
||||
return clockSensors[i].number < clockSensors[j].number
|
||||
})
|
||||
|
||||
return clockSensors, nil
|
||||
|
||||
Reference in New Issue
Block a user