Skip to content

Instantly share code, notes, and snippets.

@joejulian
Created February 28, 2018 19:09
Show Gist options
  • Save joejulian/2966f02cb2468920600eda1790c48b57 to your computer and use it in GitHub Desktop.
Save joejulian/2966f02cb2468920600eda1790c48b57 to your computer and use it in GitHub Desktop.
package bindata
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"strings"
)
func bindata_read(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
var buf bytes.Buffer
_, err = io.Copy(&buf, gz)
gz.Close()
if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err)
}
return buf.Bytes(), nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment