MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / extractGZIP

Function extractGZIP

src/compression.go:123–148  ·  view source on GitHub ↗
(gzipBody []byte, fileSource string)

Source from the content-addressed store, hash-verified

121}
122
123func extractGZIP(gzipBody []byte, fileSource string) (body []byte, err error) {
124
125 var b = bytes.NewBuffer(gzipBody)
126
127 var r io.Reader
128 r, err = gzip.NewReader(b)
129 if err != nil {
130 // Keine gzip Datei
131 body = gzipBody
132 err = nil
133 return
134 }
135
136 showInfo("Extract gzip:" + fileSource)
137
138 var resB bytes.Buffer
139 _, err = resB.ReadFrom(r)
140 if err != nil {
141 body = gzipBody
142 err = nil
143 return
144 }
145
146 body = resB.Bytes()
147 return
148}
149
150func compressGZIP(data *[]byte, file string) (err error) {
151

Callers 1

getProviderDataFunction · 0.85

Calls 1

showInfoFunction · 0.85

Tested by

no test coverage detected