Merge pull request #99 from tamird/filepath-not-path

Use `filepath` everywhere instead of `path`
This commit is contained in:
Jim Teeuwen 2015-07-02 18:58:11 +02:00
commit 38ae5514e6
8 changed files with 13 additions and 33 deletions

View File

@ -34,7 +34,6 @@ func writeDebugHeader(w io.Writer) error {
"io/ioutil" "io/ioutil"
"strings" "strings"
"os" "os"
"path"
"path/filepath" "path/filepath"
) )

View File

@ -107,7 +107,6 @@ func header_compressed_nomemcopy(w io.Writer) error {
"os" "os"
"time" "time"
"io/ioutil" "io/ioutil"
"path"
"path/filepath" "path/filepath"
) )
@ -145,7 +144,6 @@ func header_compressed_memcopy(w io.Writer) error {
"os" "os"
"time" "time"
"io/ioutil" "io/ioutil"
"path"
"path/filepath" "path/filepath"
) )
@ -182,7 +180,6 @@ func header_uncompressed_nomemcopy(w io.Writer) error {
"os" "os"
"time" "time"
"io/ioutil" "io/ioutil"
"path"
"path/filepath" "path/filepath"
) )
@ -208,7 +205,6 @@ func header_uncompressed_memcopy(w io.Writer) error {
"os" "os"
"time" "time"
"io/ioutil" "io/ioutil"
"path"
"path/filepath" "path/filepath"
) )
`) `)

View File

@ -21,7 +21,7 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
err = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755)) err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil { if err != nil {
return err return err
} }
@ -45,7 +45,7 @@ func RestoreAssets(dir, name string) error {
} }
// Dir // Dir
for _, child := range children { for _, child := range children {
err = RestoreAssets(dir, path.Join(name, child)) err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil { if err != nil {
return err return err
} }

View File

@ -17,7 +17,6 @@ import (
"os" "os"
"time" "time"
"io/ioutil" "io/ioutil"
"path"
"path/filepath" "path/filepath"
) )
@ -278,7 +277,7 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
err = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755)) err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil { if err != nil {
return err return err
} }
@ -302,7 +301,7 @@ func RestoreAssets(dir, name string) error {
} }
// Dir // Dir
for _, child := range children { for _, child := range children {
err = RestoreAssets(dir, path.Join(name, child)) err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil { if err != nil {
return err return err
} }

View File

@ -13,26 +13,15 @@ import (
"compress/gzip" "compress/gzip"
"fmt" "fmt"
"io" "io"
"reflect"
"strings" "strings"
"unsafe"
"os" "os"
"time" "time"
"io/ioutil" "io/ioutil"
"path"
"path/filepath" "path/filepath"
) )
func bindataRead(data, name string) ([]byte, error) { func bindataRead(data, name string) ([]byte, error) {
var empty [0]byte gz, err := gzip.NewReader(strings.NewReader(data))
sx := (*reflect.StringHeader)(unsafe.Pointer(&data))
b := empty[:]
bx := (*reflect.SliceHeader)(unsafe.Pointer(&b))
bx.Data = sx.Data
bx.Len = len(data)
bx.Cap = bx.Len
gz, err := gzip.NewReader(bytes.NewBuffer(b))
if err != nil { if err != nil {
return nil, fmt.Errorf("Read %q: %v", name, err) return nil, fmt.Errorf("Read %q: %v", name, err)
} }
@ -288,7 +277,7 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
err = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755)) err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil { if err != nil {
return err return err
} }
@ -312,7 +301,7 @@ func RestoreAssets(dir, name string) error {
} }
// Dir // Dir
for _, child := range children { for _, child := range children {
err = RestoreAssets(dir, path.Join(name, child)) err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil { if err != nil {
return err return err
} }

View File

@ -13,7 +13,6 @@ import (
"io/ioutil" "io/ioutil"
"strings" "strings"
"os" "os"
"path"
"path/filepath" "path/filepath"
) )
@ -229,7 +228,7 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
err = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755)) err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil { if err != nil {
return err return err
} }
@ -253,7 +252,7 @@ func RestoreAssets(dir, name string) error {
} }
// Dir // Dir
for _, child := range children { for _, child := range children {
err = RestoreAssets(dir, path.Join(name, child)) err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil { if err != nil {
return err return err
} }

View File

@ -14,7 +14,6 @@ import (
"os" "os"
"time" "time"
"io/ioutil" "io/ioutil"
"path"
"path/filepath" "path/filepath"
) )
type asset struct { type asset struct {
@ -246,7 +245,7 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
err = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755)) err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil { if err != nil {
return err return err
} }
@ -270,7 +269,7 @@ func RestoreAssets(dir, name string) error {
} }
// Dir // Dir
for _, child := range children { for _, child := range children {
err = RestoreAssets(dir, path.Join(name, child)) err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil { if err != nil {
return err return err
} }

View File

@ -16,7 +16,6 @@ import (
"os" "os"
"time" "time"
"io/ioutil" "io/ioutil"
"path"
"path/filepath" "path/filepath"
) )
@ -268,7 +267,7 @@ func RestoreAsset(dir, name string) error {
if err != nil { if err != nil {
return err return err
} }
err = os.MkdirAll(_filePath(dir, path.Dir(name)), os.FileMode(0755)) err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil { if err != nil {
return err return err
} }
@ -292,7 +291,7 @@ func RestoreAssets(dir, name string) error {
} }
// Dir // Dir
for _, child := range children { for _, child := range children {
err = RestoreAssets(dir, path.Join(name, child)) err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil { if err != nil {
return err return err
} }