MCPcopy Create free account
hub / github.com/devld/go-drive / ArrayMap

Function ArrayMap

common/utils/utils.go:210–216  ·  view source on GitHub ↗
(a []TF, convert func(*TF) TT)

Source from the content-addressed store, hash-verified

208}
209
210func ArrayMap[TF any, TT any](a []TF, convert func(*TF) TT) []TT {
211 r := make([]TT, len(a))
212 for i := range a {
213 r[i] = convert(&a[i])
214 }
215 return r
216}
217
218func ArrayMapWithError[TF any, TT any](a []TF, convert func(*TF) (TT, error)) ([]TT, error) {
219 r := make([]TT, len(a))

Callers 13

newValuesFunction · 0.92
ListMethod · 0.92
vm_findEntriesFunction · 0.92
IndexMethod · 0.92
SearchMethod · 0.92
DeleteMethod · 0.92
buildWildcardQueryFunction · 0.92
ReadDirMethod · 0.92
ReadDirMethod · 0.92
initFunction · 0.92
ListMethod · 0.92
PutEntriesMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected