MCPcopy Create free account
hub / github.com/eth-easl/dirigent / ExtractField

Function ExtractField

pkg/map/maps.go:64–77  ·  view source on GitHub ↗
(m []T, extractor func(T) string)

Source from the content-addressed store, hash-verified

62}
63
64func ExtractField[T any](m []T, extractor func(T) string) ([]string, map[string]T) {
65 var res []string
66
67 mm := make(map[string]T)
68
69 for i := 0; i < len(m); i++ {
70 val := extractor(m[i])
71
72 res = append(res, val)
73 mm[val] = m[i]
74 }
75
76 return res, mm
77}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected