Documentation
¶
Overview ¶
Package util provides utility functions for operations like sorting.
Package util provides utility functions for operations like sorting and iterating over slices and maps
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSortedMapKeys ¶
GetSortedMapKeys returns a sorted slice of keys from a map for deterministic iteration.
func SortAndIterateSlice ¶
func SortAndIterateSlice(slice []string, fn SliceProcessor)
SortAndIterateSlice sorts a slice and applies a function to each item. This centralizes the common pattern of creating a copy of a slice, sorting it, and then iterating over the sorted values.
func SortStringMapKeys ¶ added in v0.9.0
SortStringMapKeys returns a sorted slice of keys from a string map.
func SortStringSlice ¶ added in v0.9.0
func SortStringSlice(slice []string)
SortStringSlice sorts any string slice in-place..
func SortStringSlices ¶ added in v0.9.0
func SortStringSlices(slices ...[]string)
SortStringSlices sorts multiple string slices in-place.
Types ¶
type SliceProcessor ¶
type SliceProcessor func(string)
SliceProcessor is a function that processes a string item.