Merge pull request #32 from XenoPhex/master
Asset retrieval is independent of OS Path
This commit is contained in:
commit
394d5b27c0
1
debug.go
1
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.
|
||||
|
|
|
@ -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
3
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user