Skip to content

Commit 1387dcb

Browse files
committed
oem/smc: address linter
Signed-off-by: Matt Vandermeulen <[email protected]>
1 parent 0e46b21 commit 1387dcb

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

oem/smc/drive.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//
2+
// SPDX-License-Identifier: BSD-3-Clause
3+
//
4+
15
package smc
26

37
import (
@@ -61,15 +65,15 @@ func FromDrive(drive *redfish.Drive) (Drive, error) {
6165
// in the Oem sections - certain models and bmc firmwares will mix
6266
// these up, so we check both
6367
smcDrive.indicateTarget = t.Actions.Oem.DriveIndicate.Target
64-
if len(t.Actions.Oem.SmcDriveIndicate.Target) > 0 {
68+
if t.Actions.Oem.SmcDriveIndicate.Target != "" {
6569
smcDrive.indicateTarget = t.Actions.Oem.SmcDriveIndicate.Target
6670
}
6771

6872
return smcDrive, nil
6973
}
7074

7175
// Indicate will set the indicator light activity, true for on, false for off
72-
func (d Drive) Indicate(active bool) error {
76+
func (d *Drive) Indicate(active bool) error {
7377
// Return a common error to let the user try falling back on the normal gofish path
7478
if d.indicateTarget == "" {
7579
return ErrActionNotSupported

oem/smc/drive_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//
2+
// SPDX-License-Identifier: BSD-3-Clause
3+
//
4+
15
package smc
26

37
import (
@@ -58,7 +62,7 @@ func TestSmcDriveOem(t *testing.T) {
5862
}
5963

6064
if smcDrive.Temperature != 33 {
61-
t.Errorf("unexpected oem drive temerature: %d", smcDrive.Temperature)
65+
t.Errorf("unexpected oem drive temperature: %d", smcDrive.Temperature)
6266
}
6367

6468
if smcDrive.indicateTarget != "/redfish/v1/Chassis/NVMeSSD.0.Group.0.StorageBackplane/Drives/Disk.Bay.22/Actions/Oem/Drive.Indicate" {

0 commit comments

Comments
 (0)