Skip to content

Commit

Permalink
Decuddle some returns
Browse files Browse the repository at this point in the history
  • Loading branch information
splaspood committed Apr 12, 2024
1 parent 874ca0d commit 3a648b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/asrockrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ func NewAsrockrackVendorConfigManager(configFormat string, vendorOptions map[str
// FindMenu locates an existing asrockrackBiosCfgMenu if one exists in the ConfigData, if not
// it creates one and returns a pointer to that.
func (cm *asrockrackVendorConfig) FindMenu(menuName string) (m *asrockrackBiosCfgMenu) {
if cm.ConfigData.BiosCfg.Menus == nil {
return
}

for _, m = range cm.ConfigData.BiosCfg.Menus {
if m.Name == menuName {
return
Expand Down
3 changes: 3 additions & 0 deletions config/dell.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func NewDellVendorConfigManager(configFormat string, vendorOptions map[string]st
}

dell.setSystemConfiguration(vendorOptions["model"], vendorOptions["servicetag"])

return dell, nil
}

Expand Down Expand Up @@ -114,12 +115,14 @@ func (cm *dellVendorConfig) Marshal() (string, error) {
if err != nil {
return "", err
}

return string(x), nil
case "json":
x, err := json.Marshal(cm.ConfigData.SystemConfiguration)
if err != nil {
return "", err
}

return string(x), nil
default:
return "", UnknownConfigFormatError(strings.ToLower(cm.ConfigFormat))
Expand Down

0 comments on commit 3a648b8

Please sign in to comment.