Merge pull request #32 from XenoPhex/master

Asset retrieval is independent of OS Path
This commit is contained in:
jimt 2014-05-16 20:22:52 +02:00
commit 394d5b27c0
3 changed files with 7 additions and 1 deletions

View File

@ -32,6 +32,7 @@ func writeDebugHeader(w io.Writer) error {
_, err := fmt.Fprintf(w, `import (
"fmt"
"io/ioutil"
"strings"
)
// bindata_read reads the given file from disk. It returns an error on failure.

View File

@ -81,6 +81,7 @@ func header_compressed_nomemcopy(w io.Writer) error {
"fmt"
"io"
"reflect"
"strings"
"unsafe"
)
@ -119,6 +120,7 @@ func header_compressed_memcopy(w io.Writer) error {
"compress/gzip"
"fmt"
"io"
"strings"
)
func bindata_read(data []byte, name string) ([]byte, error) {
@ -146,6 +148,7 @@ func header_uncompressed_nomemcopy(w io.Writer) error {
_, err := fmt.Fprintf(w, `import (
"fmt"
"reflect"
"strings"
"unsafe"
)
@ -167,6 +170,7 @@ func bindata_read(data, name string) ([]byte, error) {
func header_uncompressed_memcopy(w io.Writer) error {
_, err := fmt.Fprintf(w, `import (
"fmt"
"strings"
)
`)
return err

3
toc.go
View File

@ -33,7 +33,8 @@ func writeTOCHeader(w io.Writer) error {
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
if f, ok := _bindata[name]; ok {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
return f()
}
return nil, fmt.Errorf("Asset %%s not found", name)