Skip to content

Commit

Permalink
Merge pull request #127 from numtide/fix/smbios-language
Browse files Browse the repository at this point in the history
fix: change language in smbios to an array
  • Loading branch information
brianmcgee authored Oct 26, 2024
2 parents 39e20ab + abde94e commit 98bc46d
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions pkg/facter/smbios.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type Smbios struct {
HardwareSecurity []hwinfo.Smbios `json:"hardware_security,omitempty"`

// Language contains language-related information, including supported and current languages.
Language *hwinfo.SmbiosLanguage `json:"language,omitempty"`
Language []hwinfo.Smbios `json:"language,omitempty"`

// Memory64Error provides information on 64-bit memory errors.
Memory64Error []hwinfo.Smbios `json:"memory_64_error,omitempty"`
Expand Down Expand Up @@ -114,13 +114,7 @@ func (s *Smbios) add(item hwinfo.Smbios) error {
case hwinfo.SmbiosTypeHardwareSecurity:
s.GroupAssociations = append(s.GroupAssociations, item)
case hwinfo.SmbiosTypeLanguage:
if s.Language != nil {
return fmt.Errorf("language field is already set")
} else if language, ok := item.(hwinfo.SmbiosLanguage); !ok {
return fmt.Errorf("expected hwinfo.SmbiosLanguage, found %T", item)
} else {
s.Language = &language
}
s.Language = append(s.Language, item)
case hwinfo.SmbiosTypeMemory64Error:
s.Memory64Error = append(s.Memory64Error, item)
case hwinfo.SmbiosTypeMemoryArray:
Expand Down

0 comments on commit 98bc46d

Please sign in to comment.