MCPcopy
hub / github.com/donknap/dpanel / PluckArrayWalk

Function PluckArrayWalk

common/function/array.go:60–69  ·  view source on GitHub ↗
(v []T, walk func(i T) (R, bool))

Source from the content-addressed store, hash-verified

58}
59
60func PluckArrayWalk[T interface{}, R interface{}](v []T, walk func(i T) (R, bool)) []R {
61 result := make([]R, 0)
62 for _, item := range v {
63 newItem, ok := walk(item)
64 if ok {
65 result = append(result, newItem)
66 }
67 }
68 return result
69}
70
71func PluckArrayItemWalk[T interface{}](v []T, walk func(item T) bool) (T, int, bool) {
72 var result T

Callers 15

mainFunction · 0.92
initRSAFunction · 0.92
HandleMethod · 0.92
DnsApiMethod · 0.92
ApplyMethod · 0.92
ImportMethod · 0.92
DeleteMethod · 0.92
DownloadMethod · 0.92
GetListMethod · 0.92
PruneMethod · 0.92
ExportMethod · 0.92
DownloadMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected