diff --git a/debug.go b/debug.go index 92309b6..9abde60 100644 --- a/debug.go +++ b/debug.go @@ -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. diff --git a/release.go b/release.go index 2f8e23c..f7e6e7c 100644 --- a/release.go +++ b/release.go @@ -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 diff --git a/toc.go b/toc.go index b056e0e..b99bb88 100644 --- a/toc.go +++ b/toc.go @@ -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)