MCPcopy Index your code
hub / github.com/goinaction/code / pull

Function pull

chapter10/listing04/listing04.go:82–90  ·  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

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

Callers 1

CopyFunction · 0.70

Calls 1

PullMethod · 0.65

Tested by

no test coverage detected