MCPcopy Create free account
hub / github.com/assetnote/newtowner / GetMapKeys

Function GetMapKeys

internal/util/stringutil.go:20–26  ·  view source on GitHub ↗

GetMapKeys returns a slice of keys from a map. This is a generic function that works with any comparable key type and any value type.

(m map[K]V)

Source from the content-addressed store, hash-verified

18// GetMapKeys returns a slice of keys from a map.
19// This is a generic function that works with any comparable key type and any value type.
20func GetMapKeys[K comparable, V any](m map[K]V) []K {
21 keys := make([]K, 0, len(m))
22 for k := range m {
23 keys = append(keys, k)
24 }
25 return keys
26}

Callers 1

CheckURLsMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected