package util
import "golang.org/x/tools/internal/mcp/internal/util"
Index ¶
- func Apply[S ~[]E, E, F any](x S, f func(E) F) []F
- func KeySlice[M ~map[K]V, K comparable, V any](m M) []K
- func Sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V]
Functions ¶
func Apply ¶
func Apply[S ~[]E, E, F any](x S, f func(E) F) []F
Apply returns a new slice resulting from applying f to each element of x.
func KeySlice ¶
func KeySlice[M ~map[K]V, K comparable, V any](m M) []K
keySlice returns the keys of the map M, like slices.Collect(maps.Keys(m)).
func Sorted ¶
sorted returns an iterator over the entries of m in key order.
Source Files ¶
util.go
- Version
- v0.33.0
- Published
- May 5, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 18 minutes ago –
Tools for package owners.