MCPcopy
hub / github.com/perkeep/perkeep / Foreach

Function Foreach

pkg/sorted/kv.go:276–278  ·  view source on GitHub ↗

Foreach runs fn for each key/value pair in kv. If fn returns an error, that same error is returned from Foreach and iteration stops.

(kv KeyValue, fn func(key, value string) error)

Source from the content-addressed store, hash-verified

274// Foreach runs fn for each key/value pair in kv. If fn returns an error,
275// that same error is returned from Foreach and iteration stops.
276func Foreach(kv KeyValue, fn func(key, value string) error) error {
277 return ForeachInRange(kv, "", "", fn)
278}
279
280// ForeachInRange runs fn for each key/value pair in kv in the range
281// of start and end, which behave the same as kv.Find. If fn returns

Callers 4

TestPackLargeFunction · 0.92
countSortedRowsFunction · 0.92
TestReindexFunction · 0.92
anyMetaMethod · 0.92

Calls 1

ForeachInRangeFunction · 0.85

Tested by 3

TestPackLargeFunction · 0.74
countSortedRowsFunction · 0.74
TestReindexFunction · 0.74