bindataRead
This commit is contained in:
parent
4d36d97d1d
commit
ffff253524
6
debug.go
6
debug.go
|
@ -38,8 +38,8 @@ func writeDebugHeader(w io.Writer) error {
|
|||
"path/filepath"
|
||||
)
|
||||
|
||||
// bindata_read reads the given file from disk. It returns an error on failure.
|
||||
func bindata_read(path, name string) ([]byte, error) {
|
||||
// bindataRead reads the given file from disk. It returns an error on failure.
|
||||
func bindataRead(path, name string) ([]byte, error) {
|
||||
buf, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
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) {
|
||||
path := %s
|
||||
name := %q
|
||||
bytes, err := bindata_read(path, name)
|
||||
bytes, err := bindataRead(path, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
12
release.go
12
release.go
|
@ -113,7 +113,7 @@ func header_compressed_nomemcopy(w io.Writer) error {
|
|||
"path/filepath"
|
||||
)
|
||||
|
||||
func bindata_read(data, name string) ([]byte, error) {
|
||||
func bindataRead(data, name string) ([]byte, error) {
|
||||
var empty [0]byte
|
||||
sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
|
||||
b := empty[:]
|
||||
|
@ -159,7 +159,7 @@ func header_compressed_memcopy(w io.Writer) error {
|
|||
"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))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Read %%q: %%v", name, err)
|
||||
|
@ -196,7 +196,7 @@ func header_uncompressed_nomemcopy(w io.Writer) error {
|
|||
"path/filepath"
|
||||
)
|
||||
|
||||
func bindata_read(data, name string) ([]byte, error) {
|
||||
func bindataRead(data, name string) ([]byte, error) {
|
||||
var empty [0]byte
|
||||
sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
|
||||
b := empty[:]
|
||||
|
@ -278,7 +278,7 @@ func compressed_nomemcopy(w io.Writer, asset *Asset, r io.Reader) error {
|
|||
_, err = fmt.Fprintf(w, `"
|
||||
|
||||
func %s_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_%s,
|
||||
%q,
|
||||
)
|
||||
|
@ -305,7 +305,7 @@ func compressed_memcopy(w io.Writer, asset *Asset, r io.Reader) error {
|
|||
_, err = fmt.Fprintf(w, `")
|
||||
|
||||
func %s_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_%s,
|
||||
%q,
|
||||
)
|
||||
|
@ -329,7 +329,7 @@ func uncompressed_nomemcopy(w io.Writer, asset *Asset, r io.Reader) error {
|
|||
_, err = fmt.Fprintf(w, `"
|
||||
|
||||
func %s_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_%s,
|
||||
%q,
|
||||
)
|
||||
|
|
10
testdata/out/compress-memcopy.go
vendored
10
testdata/out/compress-memcopy.go
vendored
|
@ -13,7 +13,7 @@ import (
|
|||
"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))
|
||||
if err != nil {
|
||||
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")
|
||||
|
||||
func in_a_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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")
|
||||
|
||||
func in_b_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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")
|
||||
|
||||
func in_c_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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")
|
||||
|
||||
func in_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_in_test_asset,
|
||||
"in/test.asset",
|
||||
)
|
||||
|
|
10
testdata/out/compress-nomemcopy.go
vendored
10
testdata/out/compress-nomemcopy.go
vendored
|
@ -15,7 +15,7 @@ import (
|
|||
"path/filepath"
|
||||
)
|
||||
|
||||
func bindata_read(data, name string) ([]byte, error) {
|
||||
func bindataRead(data, name string) ([]byte, error) {
|
||||
var empty [0]byte
|
||||
sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
|
||||
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"
|
||||
|
||||
func in_a_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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"
|
||||
|
||||
func in_b_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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"
|
||||
|
||||
func in_c_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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"
|
||||
|
||||
func in_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_in_test_asset,
|
||||
"in/test.asset",
|
||||
)
|
||||
|
|
12
testdata/out/debug.go
vendored
12
testdata/out/debug.go
vendored
|
@ -9,8 +9,8 @@ import (
|
|||
"path/filepath"
|
||||
)
|
||||
|
||||
// bindata_read reads the given file from disk. It returns an error on failure.
|
||||
func bindata_read(path, name string) ([]byte, error) {
|
||||
// bindataRead reads the given file from disk. It returns an error on failure.
|
||||
func bindataRead(path, name string) ([]byte, error) {
|
||||
buf, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
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) {
|
||||
path := "/Users/tamird/src/go/src/github.com/jteeuwen/go-bindata/testdata/in/a/test.asset"
|
||||
name := "in/a/test.asset"
|
||||
bytes, err := bindata_read(path, name)
|
||||
bytes, err := bindataRead(path, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ func in_a_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"
|
||||
name := "in/b/test.asset"
|
||||
bytes, err := bindata_read(path, name)
|
||||
bytes, err := bindataRead(path, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ func in_b_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"
|
||||
name := "in/c/test.asset"
|
||||
bytes, err := bindata_read(path, name)
|
||||
bytes, err := bindataRead(path, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ func in_c_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"
|
||||
name := "in/test.asset"
|
||||
bytes, err := bindata_read(path, name)
|
||||
bytes, err := bindataRead(path, name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
10
testdata/out/nocompress-nomemcopy.go
vendored
10
testdata/out/nocompress-nomemcopy.go
vendored
|
@ -12,7 +12,7 @@ import (
|
|||
"path/filepath"
|
||||
)
|
||||
|
||||
func bindata_read(data, name string) ([]byte, error) {
|
||||
func bindataRead(data, name string) ([]byte, error) {
|
||||
var empty [0]byte
|
||||
sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
|
||||
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"
|
||||
|
||||
func in_a_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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"
|
||||
|
||||
func in_b_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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"
|
||||
|
||||
func in_c_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_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"
|
||||
|
||||
func in_test_asset_bytes() ([]byte, error) {
|
||||
return bindata_read(
|
||||
return bindataRead(
|
||||
_in_test_asset,
|
||||
"in/test.asset",
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
Block a user