Use filepath everywhere instead of path.{} functions for portability - fixes #656

This commit is contained in:
Harshavardhana
2015-06-18 16:02:34 -07:00
parent 285b1cc5d8
commit 641f07cecf
17 changed files with 94 additions and 80 deletions

View File

@@ -22,7 +22,7 @@ import (
"errors"
"fmt"
"os"
"path"
"path/filepath"
"reflect"
"runtime"
"strconv"
@@ -151,7 +151,7 @@ func createStackEntry() StackEntry {
host, _ := os.Hostname()
pc, file, line, _ := runtime.Caller(2)
function := runtime.FuncForPC(pc).Name()
_, function = path.Split(function)
_, function = filepath.Split(function)
file = strings.TrimPrefix(file, gopath) // trim gopath from file
data := GetGlobalState()
@@ -222,8 +222,8 @@ func (err Error) Error() string {
func init() {
_, iodineFile, _, _ := runtime.Caller(0)
iodineFile = path.Dir(iodineFile) // trim iodine.go
iodineFile = path.Dir(iodineFile) // trim iodine
iodineFile = path.Dir(iodineFile) // trim minio
gopath = path.Dir(iodineFile) + "/" // trim github.com
iodineFile = filepath.Dir(iodineFile) // trim iodine.go
iodineFile = filepath.Dir(iodineFile) // trim iodine
iodineFile = filepath.Dir(iodineFile) // trim minio
gopath = filepath.Dir(iodineFile) + "/" // trim github.com
}