MCPcopy Create free account
hub / github.com/goinaction/code / pull

Function pull

chapter10/listing02/listing02.go:76–84  ·  view source on GitHub ↗

============================================================================= pull knows how to pull bulks of data from any Puller.

(p Puller, data []Data)

Source from the content-addressed store, hash-verified

74
75// pull knows how to pull bulks of data from any Puller.
76func pull(p Puller, data []Data) (int, error) {
77 for i := range data {
78 if err := p.Pull(&data[i]); err != nil {
79 return i, err
80 }
81 }
82
83 return len(data), nil
84}
85
86// store knows how to store bulks of data from any Storer.
87func store(s Storer, data []Data) (int, error) {

Callers 1

CopyFunction · 0.70

Calls 1

PullMethod · 0.65

Tested by

no test coverage detected