MCPcopy
hub / github.com/go-bindata/go-bindata / bindataRead

Function bindataRead

testdata/out/compress-memcopy.go:21–39  ·  view source on GitHub ↗
(data []byte, name string)

Source from the content-addressed store, hash-verified

19)
20
21func bindataRead(data []byte, name string) ([]byte, error) {
22 gz, err := gzip.NewReader(bytes.NewBuffer(data))
23 if err != nil {
24 return nil, fmt.Errorf("read %q: %v", name, err)
25 }
26
27 var buf bytes.Buffer
28 _, err = io.Copy(&buf, gz)
29 clErr := gz.Close()
30
31 if err != nil {
32 return nil, fmt.Errorf("read %q: %v", name, err)
33 }
34 if clErr != nil {
35 return nil, err
36 }
37
38 return buf.Bytes(), nil
39}
40
41type asset struct {
42 bytes []byte

Callers 4

inATestAssetBytesFunction · 0.70
inBTestAssetBytesFunction · 0.70
inCTestAssetBytesFunction · 0.70
inTestAssetBytesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…