Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
linter-settings:
linters-settings:
misspell:
locale: US

Expand Down
4 changes: 2 additions & 2 deletions internal/commands/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ func formatSingleJSON(configurations map[string]interface{}) (string, error) {
for _, cfg := range configurations {
config = cfg
}
marshalled, err := json.MarshalIndent(config, "", " ")
marshaled, err := json.MarshalIndent(config, "", " ")
if err != nil {
return "", err
}

return string(marshalled), nil
return string(marshaled), nil
}
6 changes: 3 additions & 3 deletions parser/cyclonedx/cyclonedx.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ func (*Parser) Unmarshal(p []byte, v interface{}) error {
if bomFileFormat == cyclonedx.BOMFileFormatXML {
var data cyclonedx.BOM
if err := xml.Unmarshal(p, &data); err != nil {
return fmt.Errorf("unmarshalling XML error: %v", err)
return fmt.Errorf("unmarshaling XML error: %v", err)
}
if d, err := json.Marshal(data); err == nil {
temp = d
} else {
return fmt.Errorf("marshalling JSON error: %v", err)
return fmt.Errorf("marshaling JSON error: %v", err)
}
}

err := json.Unmarshal(temp, v)
if err != nil {
return fmt.Errorf("unmarshalling JSON error: %v", err)
return fmt.Errorf("unmarshaling JSON error: %v", err)
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions parser/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ func Format(configurations map[string]interface{}) (string, error) {
// object where each key is the path to the file and the contents are the
// parsed configurations.
func FormatJSON(configurations map[string]interface{}) (string, error) {
marshalled, err := json.MarshalIndent(configurations, "", " ")
marshaled, err := json.MarshalIndent(configurations, "", " ")
if err != nil {
return "", fmt.Errorf("marshal configs: %w", err)
}

return string(marshalled), nil
return string(marshaled), nil
}

// FormatCombined takes in multiple configurations, combines them, and formats the
Expand Down
2 changes: 1 addition & 1 deletion parser/spdx/spdx.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (*Parser) Unmarshal(p []byte, v interface{}) error {

out, err := json.Marshal(doc)
if err != nil {
return fmt.Errorf("error while marshalling %v: %v", p, err)
return fmt.Errorf("error while marshaling %v: %v", p, err)
}

if err := json.Unmarshal(out, v); err != nil {
Expand Down