Skip to content

Commit

Permalink
Delete deprecated stringutil functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bufdev committed Nov 22, 2023
1 parent 7f54239 commit a16c358
Showing 1 changed file with 0 additions and 56 deletions.
56 changes: 0 additions & 56 deletions private/pkg/stringutil/stringutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,6 @@ func SplitTrimLinesNoEmpty(output string) []string {
return lines
}

// MapToSortedSlice transforms m to a sorted slice.
//
// Deprecated: Use slicesext.MapToSortedSlice instead.
func MapToSortedSlice(m map[string]struct{}) []string {
return slicesext.MapKeysToSortedSlice(m)
}

// MapToSlice transforms m to a slice.
//
// Deprecated: Use slicesext.MapToSlice instead.
func MapToSlice(m map[string]struct{}) []string {
return slicesext.MapKeysToSlice(m)
}

// SliceToMap transforms s to a map.
//
// Deprecated: Use slicesext.ToStructMap instead.
func SliceToMap(s []string) map[string]struct{} {
return slicesext.ToStructMap(s)
}

// SliceToUniqueSortedSlice returns a sorted copy of s with no duplicates.
//
// Deprecated: Use slicesext.ToUniqueSorted instead.
func SliceToUniqueSortedSlice(s []string) []string {
return slicesext.ToUniqueSorted(s)
}

// SliceToUniqueSortedSliceFilterEmptyStrings returns a sorted copy of s with no duplicates and no empty strings.
//
// Strings with only spaces are considered empty.
Expand All @@ -97,34 +69,6 @@ func SliceToUniqueSortedSliceFilterEmptyStrings(s []string) []string {
return slicesext.MapKeysToSortedSlice(m)
}

// SliceToChunks splits s into chunks of the given chunk size.
//
// If s is nil or empty, returns empty.
// If chunkSize is <=0, returns [][]string{s}.
//
// Deprecated: use slicesext.ToChunks instead.
func SliceToChunks(s []string, chunkSize int) [][]string {
return slicesext.ToChunks(s, chunkSize)
}

// SliceElementsEqual returns true if the two slices have equal elements.
//
// Nil and empty slices are treated as equals.
//
// Deprecated: use slicesext.ElementsEqual instead.
func SliceElementsEqual(one []string, two []string) bool {
return slicesext.ElementsEqual(one, two)
}

// SliceElementsContained returns true if superset contains subset.
//
// Nil and empty slices are treated as equals.
//
// Deprecated: use slicesext.ElementsContained instead.
func SliceElementsContained(superset []string, subset []string) bool {
return slicesext.ElementsContained(superset, subset)
}

// JoinSliceQuoted joins the slice with quotes.
func JoinSliceQuoted(s []string, sep string) string {
if len(s) == 0 {
Expand Down

0 comments on commit a16c358

Please sign in to comment.