package util

import "golang.org/x/tools/internal/mcp/internal/util"

Index

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

func Sorted[M ~map[K]V, K cmp.Ordered, V any](m M) iter.Seq2[K, V]

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
windows/amd64
Imports
3 packages
Last checked
19 minutes ago

Tools for package owners.