MCPcopy Index your code
hub / github.com/github/gh-aw / SortedKeys

Function SortedKeys

pkg/sliceutil/sliceutil.go:63–65  ·  view source on GitHub ↗

SortedKeys returns the keys of a map in sorted order. K must satisfy cmp.Ordered (e.g. string, int). This is a pure function that does not modify the input map.

(m map[K]V)

Source from the content-addressed store, hash-verified

61// K must satisfy cmp.Ordered (e.g. string, int).
62// This is a pure function that does not modify the input map.
63func SortedKeys[K cmp.Ordered, V any](m map[K]V) []K {
64 return slices.Sorted(maps.Keys(m))
65}
66
67// Any returns true if at least one element in the slice satisfies the predicate.
68// Returns false for nil or empty slices.

Callers 15

marshalSortedMapFunction · 0.92
sortedDependencyKeysFunction · 0.92
findCyclePathFunction · 0.92
appendContainerEnvFunction · 0.92
buildCrossRunMCPHealthFunction · 0.92
convertToolsToConfigFunction · 0.92
parseRedactedDomainsLogFunction · 0.92

Calls

no outgoing calls

Tested by 1