(m []T, extractor func(T) string)
| 62 | } |
| 63 | |
| 64 | func 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected