bindataRead

This commit is contained in:
Tamir Duberstein 2015-05-11 15:42:14 -04:00
parent 4d36d97d1d
commit ffff253524
6 changed files with 30 additions and 30 deletions

View File

@ -38,8 +38,8 @@ func writeDebugHeader(w io.Writer) error {
"path/filepath" "path/filepath"
) )
// bindata_read reads the given file from disk. It returns an error on failure. // bindataRead reads the given file from disk. It returns an error on failure.
func bindata_read(path, name string) ([]byte, error) { func bindataRead(path, name string) ([]byte, error) {
buf, err := ioutil.ReadFile(path) buf, err := ioutil.ReadFile(path)
if err != nil { if err != nil {
err = fmt.Errorf("Error reading asset %%s at %%s: %%v", name, path, err) err = fmt.Errorf("Error reading asset %%s at %%s: %%v", name, path, err)
@ -69,7 +69,7 @@ func writeDebugAsset(w io.Writer, c *Config, asset *Asset) error {
func %s() (*asset, error) { func %s() (*asset, error) {
path := %s path := %s
name := %q name := %q
bytes, err := bindata_read(path, name) bytes, err := bindataRead(path, name)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -113,7 +113,7 @@ func header_compressed_nomemcopy(w io.Writer) error {
"path/filepath" "path/filepath"
) )
func bindata_read(data, name string) ([]byte, error) { func bindataRead(data, name string) ([]byte, error) {
var empty [0]byte var empty [0]byte
sx := (*reflect.StringHeader)(unsafe.Pointer(&data)) sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
b := empty[:] b := empty[:]
@ -159,7 +159,7 @@ func header_compressed_memcopy(w io.Writer) error {
"path/filepath" "path/filepath"
) )
func bindata_read(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("Read %%q: %%v", name, err) return nil, fmt.Errorf("Read %%q: %%v", name, err)
@ -196,7 +196,7 @@ func header_uncompressed_nomemcopy(w io.Writer) error {
"path/filepath" "path/filepath"
) )
func bindata_read(data, name string) ([]byte, error) { func bindataRead(data, name string) ([]byte, error) {
var empty [0]byte var empty [0]byte
sx := (*reflect.StringHeader)(unsafe.Pointer(&data)) sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
b := empty[:] b := empty[:]
@ -278,7 +278,7 @@ func compressed_nomemcopy(w io.Writer, asset *Asset, r io.Reader) error {
_, err = fmt.Fprintf(w, `" _, err = fmt.Fprintf(w, `"
func %s_bytes() ([]byte, error) { func %s_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_%s, _%s,
%q, %q,
) )
@ -305,7 +305,7 @@ func compressed_memcopy(w io.Writer, asset *Asset, r io.Reader) error {
_, err = fmt.Fprintf(w, `") _, err = fmt.Fprintf(w, `")
func %s_bytes() ([]byte, error) { func %s_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_%s, _%s,
%q, %q,
) )
@ -329,7 +329,7 @@ func uncompressed_nomemcopy(w io.Writer, asset *Asset, r io.Reader) error {
_, err = fmt.Fprintf(w, `" _, err = fmt.Fprintf(w, `"
func %s_bytes() ([]byte, error) { func %s_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_%s, _%s,
%q, %q,
) )

View File

@ -13,7 +13,7 @@ import (
"path/filepath" "path/filepath"
) )
func bindata_read(data []byte, name string) ([]byte, error) { func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data)) gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil { if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
@ -67,7 +67,7 @@ func (fi bindata_file_info) Sys() interface{} {
var _in_a_test_asset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00") var _in_a_test_asset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00")
func in_a_test_asset_bytes() ([]byte, error) { func in_a_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_a_test_asset, _in_a_test_asset,
"in/a/test.asset", "in/a/test.asset",
) )
@ -87,7 +87,7 @@ func in_a_test_asset() (*asset, error) {
var _in_b_test_asset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00") var _in_b_test_asset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00")
func in_b_test_asset_bytes() ([]byte, error) { func in_b_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_b_test_asset, _in_b_test_asset,
"in/b/test.asset", "in/b/test.asset",
) )
@ -107,7 +107,7 @@ func in_b_test_asset() (*asset, error) {
var _in_c_test_asset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00") var _in_c_test_asset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00")
func in_c_test_asset_bytes() ([]byte, error) { func in_c_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_c_test_asset, _in_c_test_asset,
"in/c/test.asset", "in/c/test.asset",
) )
@ -127,7 +127,7 @@ func in_c_test_asset() (*asset, error) {
var _in_test_asset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00") var _in_test_asset = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00")
func in_test_asset_bytes() ([]byte, error) { func in_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_test_asset, _in_test_asset,
"in/test.asset", "in/test.asset",
) )

View File

@ -15,7 +15,7 @@ import (
"path/filepath" "path/filepath"
) )
func bindata_read(data, name string) ([]byte, error) { func bindataRead(data, name string) ([]byte, error) {
var empty [0]byte var empty [0]byte
sx := (*reflect.StringHeader)(unsafe.Pointer(&data)) sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
b := empty[:] b := empty[:]
@ -77,7 +77,7 @@ func (fi bindata_file_info) Sys() interface{} {
var _in_a_test_asset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00" var _in_a_test_asset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00"
func in_a_test_asset_bytes() ([]byte, error) { func in_a_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_a_test_asset, _in_a_test_asset,
"in/a/test.asset", "in/a/test.asset",
) )
@ -97,7 +97,7 @@ func in_a_test_asset() (*asset, error) {
var _in_b_test_asset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00" var _in_b_test_asset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00"
func in_b_test_asset_bytes() ([]byte, error) { func in_b_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_b_test_asset, _in_b_test_asset,
"in/b/test.asset", "in/b/test.asset",
) )
@ -117,7 +117,7 @@ func in_b_test_asset() (*asset, error) {
var _in_c_test_asset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00" var _in_c_test_asset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00"
func in_c_test_asset_bytes() ([]byte, error) { func in_c_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_c_test_asset, _in_c_test_asset,
"in/c/test.asset", "in/c/test.asset",
) )
@ -137,7 +137,7 @@ func in_c_test_asset() (*asset, error) {
var _in_test_asset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00" var _in_test_asset = "\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xd2\xd7\x57\x28\x4e\xcc\x2d\xc8\x49\x55\x48\xcb\xcc\x49\xe5\x02\x04\x00\x00\xff\xff\x8a\x82\x8c\x85\x0f\x00\x00\x00"
func in_test_asset_bytes() ([]byte, error) { func in_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_test_asset, _in_test_asset,
"in/test.asset", "in/test.asset",
) )

12
testdata/out/debug.go vendored
View File

@ -9,8 +9,8 @@ import (
"path/filepath" "path/filepath"
) )
// bindata_read reads the given file from disk. It returns an error on failure. // bindataRead reads the given file from disk. It returns an error on failure.
func bindata_read(path, name string) ([]byte, error) { func bindataRead(path, name string) ([]byte, error) {
buf, err := ioutil.ReadFile(path) buf, err := ioutil.ReadFile(path)
if err != nil { if err != nil {
err = fmt.Errorf("Error reading asset %s at %s: %v", name, path, err) err = fmt.Errorf("Error reading asset %s at %s: %v", name, path, err)
@ -27,7 +27,7 @@ type asset struct {
func in_a_test_asset() (*asset, error) { func in_a_test_asset() (*asset, error) {
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/a/test.asset" path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/a/test.asset"
name := "in/a/test.asset" name := "in/a/test.asset"
bytes, err := bindata_read(path, name) bytes, err := bindataRead(path, name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -45,7 +45,7 @@ func in_a_test_asset() (*asset, error) {
func in_b_test_asset() (*asset, error) { func in_b_test_asset() (*asset, error) {
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/b/test.asset" path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/b/test.asset"
name := "in/b/test.asset" name := "in/b/test.asset"
bytes, err := bindata_read(path, name) bytes, err := bindataRead(path, name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -63,7 +63,7 @@ func in_b_test_asset() (*asset, error) {
func in_c_test_asset() (*asset, error) { func in_c_test_asset() (*asset, error) {
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/c/test.asset" path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/c/test.asset"
name := "in/c/test.asset" name := "in/c/test.asset"
bytes, err := bindata_read(path, name) bytes, err := bindataRead(path, name)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -81,7 +81,7 @@ func in_c_test_asset() (*asset, error) {
func in_test_asset() (*asset, error) { func in_test_asset() (*asset, error) {
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/test.asset" path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/test.asset"
name := "in/test.asset" name := "in/test.asset"
bytes, err := bindata_read(path, name) bytes, err := bindataRead(path, name)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -12,7 +12,7 @@ import (
"path/filepath" "path/filepath"
) )
func bindata_read(data, name string) ([]byte, error) { func bindataRead(data, name string) ([]byte, error) {
var empty [0]byte var empty [0]byte
sx := (*reflect.StringHeader)(unsafe.Pointer(&data)) sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
b := empty[:] b := empty[:]
@ -57,7 +57,7 @@ func (fi bindata_file_info) Sys() interface{} {
var _in_a_test_asset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a" var _in_a_test_asset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a"
func in_a_test_asset_bytes() ([]byte, error) { func in_a_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_a_test_asset, _in_a_test_asset,
"in/a/test.asset", "in/a/test.asset",
) )
@ -77,7 +77,7 @@ func in_a_test_asset() (*asset, error) {
var _in_b_test_asset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a" var _in_b_test_asset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a"
func in_b_test_asset_bytes() ([]byte, error) { func in_b_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_b_test_asset, _in_b_test_asset,
"in/b/test.asset", "in/b/test.asset",
) )
@ -97,7 +97,7 @@ func in_b_test_asset() (*asset, error) {
var _in_c_test_asset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a" var _in_c_test_asset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a"
func in_c_test_asset_bytes() ([]byte, error) { func in_c_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_c_test_asset, _in_c_test_asset,
"in/c/test.asset", "in/c/test.asset",
) )
@ -117,7 +117,7 @@ func in_c_test_asset() (*asset, error) {
var _in_test_asset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a" var _in_test_asset = "\x2f\x2f\x20\x73\x61\x6d\x70\x6c\x65\x20\x66\x69\x6c\x65\x0a"
func in_test_asset_bytes() ([]byte, error) { func in_test_asset_bytes() ([]byte, error) {
return bindata_read( return bindataRead(
_in_test_asset, _in_test_asset,
"in/test.asset", "in/test.asset",
) )