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 internal/collection/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (c *Collection) AddFileDataRaw(fileName string, data []byte) {
}
}

func (c *Collection) AddFileYAML(fileName string, data interface{}) {
func (c *Collection) AddFileYAML(fileName string, data any) {
var buf bytes.Buffer

err := yaml.NewEncoder(&buf).Encode(&data)
Expand Down
9 changes: 2 additions & 7 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"os"
"os/exec"
"os/user"
"slices"
"strings"
"time"

Expand All @@ -15,13 +16,7 @@ const FilePrefix = "support-collector"

// StringInSlice matches if a string is contained in a slice.
func StringInSlice(a string, list []string) bool {
for _, b := range list {
if b == a {
return true
}
}

return false
return slices.Contains(list, a)
}

// DistinctStringSlice returns the given slice with unique values
Expand Down