Skip to content

Commit e7cce54

Browse files
author
James W. Brinkerhoff
committed
config/supermicro.go: Correcting lint
1 parent fc87035 commit e7cce54

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

config/supermicro.go

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package config
33
import (
44
"bytes"
55
"encoding/xml"
6+
"fmt"
67
"strings"
78

89
"golang.org/x/net/html/charset"
@@ -66,7 +67,7 @@ func NewSupermicroVendorConfigManager(configFormat string, vendorOptions map[str
6667
func (cm *supermicroVendorConfig) FindOrCreateSetting(path []string, value string) *supermicroBiosCfgSetting {
6768
biosCfg := cm.ConfigData.BiosCfg
6869

69-
var currentMenus *[]*supermicroBiosCfgMenu = &biosCfg.Menus
70+
var currentMenus = &biosCfg.Menus
7071

7172
for i, part := range path {
7273
if i == len(path)-1 {
@@ -98,8 +99,10 @@ func (cm *supermicroVendorConfig) FindOrCreateMenu(menus *[]*supermicroBiosCfgMe
9899
return (*menus)[i]
99100
}
100101
}
102+
101103
newMenu := &supermicroBiosCfgMenu{Name: name}
102104
*menus = append(*menus, newMenu)
105+
103106
return (*menus)[len(*menus)-1]
104107
}
105108

@@ -256,14 +259,16 @@ func (cm *supermicroVendorConfig) BootOrder(mode string) error {
256259
case "LEGACY":
257260
cm.Raw("Legacy Boot Option #1", "Hard Disk", []string{"Boot"})
258261
cm.Raw("Legacy Boot Option #2", "Network", []string{"Boot"})
262+
259263
for i := 3; i < 8; i++ {
260-
cm.Raw("Legacy Boot Option #"+string(i), "Disabled", []string{"Boot"})
264+
cm.Raw("Legacy Boot Option #"+fmt.Sprint(i), "Disabled", []string{"Boot"})
261265
}
262266
case "UEFI":
263267
cm.Raw("UEFI Boot Option #1", "UEFI Hard Disk", []string{"Boot"})
264268
cm.Raw("UEFI Boot Option #2", "UEFI Network", []string{"Boot"})
269+
265270
for i := 3; i < 9; i++ {
266-
cm.Raw("UEFI Boot Option #"+string(i), "Disabled", []string{"Boot"})
271+
cm.Raw("UEFI Boot Option #"+fmt.Sprint(i), "Disabled", []string{"Boot"})
267272
}
268273
case "DUAL":
269274
// TODO(jwb) Is this just both sets?
@@ -287,11 +292,10 @@ func (cm *supermicroVendorConfig) IntelSGX(mode string) error {
287292
}
288293

289294
func (cm *supermicroVendorConfig) SecureBoot(enable bool) error {
290-
if enable {
291-
cm.Raw("Secure Boot", "Enabled", []string{"SMC Secure Boot Configuration"})
292-
// cm.Raw("Secure Boot Mode", "Setup", []string{"SMC Secure Boot Configuration"})
293-
} else {
295+
if !enable {
294296
cm.Raw("Secure Boot", "Disabled", []string{"SMC Secure Boot Configuration"})
297+
} else {
298+
cm.Raw("Secure Boot", "Enabled", []string{"SMC Secure Boot Configuration"})
295299
}
296300

297301
return nil
@@ -323,6 +327,5 @@ func (cm *supermicroVendorConfig) SMT(enable bool) error {
323327

324328
func (cm *supermicroVendorConfig) SRIOV(enable bool) error {
325329
// TODO(jwb) Need to figure out how we do this on platforms that support it...
326-
327330
return nil
328331
}

0 commit comments

Comments
 (0)