diff --git a/internal/signalfx-agent/pkg/utils/set.go b/internal/signalfx-agent/pkg/utils/set.go index 32a225d99f..293ffdf6ed 100644 --- a/internal/signalfx-agent/pkg/utils/set.go +++ b/internal/signalfx-agent/pkg/utils/set.go @@ -1,20 +1,5 @@ package utils -// UniqueStrings returns a slice with the unique set of strings from the input -func UniqueStrings(strings []string) []string { - unique := map[string]struct{}{} - for _, v := range strings { - unique[v] = struct{}{} - } - - keys := make([]string, 0) - for k := range unique { - keys = append(keys, k) - } - - return keys -} - // StringSliceToMap converts a slice of strings into a map with keys from the slice func StringSliceToMap(strings []string) map[string]bool { // Use bool so that the user can do `if setMap[key] { ... }`` @@ -37,17 +22,6 @@ func StringSetToSlice(set map[string]bool) []string { return out } -// MergeStringSets merges 2+ string map sets into a single output map. -func MergeStringSets(sets ...map[string]bool) map[string]bool { - out := map[string]bool{} - for _, ss := range sets { - for k, v := range ss { - out[k] = v - } - } - return out -} - // StringSet creates a map set from vararg func StringSet(strings ...string) map[string]bool { return StringSliceToMap(strings) diff --git a/internal/signalfx-agent/pkg/utils/slice.go b/internal/signalfx-agent/pkg/utils/slice.go index b873cf1828..c16c83b29b 100644 --- a/internal/signalfx-agent/pkg/utils/slice.go +++ b/internal/signalfx-agent/pkg/utils/slice.go @@ -1,29 +1,5 @@ package utils -// MakeRange creates an int slice containing all ints between `min` and `max` -func MakeRange(min, max int) []int { - a := make([]int, max-min+1) - for i := range a { - a[i] = min + i - } - return a -} - -// InterfaceSliceToStringSlice returns a new slice that contains the elements -// of `is` as strings. Returns nil if any of the elements of `is` are not -// strings. -func InterfaceSliceToStringSlice(is []interface{}) []string { - var ss []string - for _, intf := range is { - if s, ok := intf.(string); ok { - ss = append(ss, s) - } else { - return nil - } - } - return ss -} - // RemoveAllElementsFromStringSlice removes all elements from toRemove that exists // in inputStrings func RemoveAllElementsFromStringSlice(inputStrings []string, toRemoveStrings []string) []string {