mirror of
https://github.com/minio/minio.git
synced 2026-11-28 07:30:50 +00:00
Use filepath everywhere instead of path.{} functions for portability - fixes #656
This commit is contained in:
1 parent
285b1cc5d8
commit
641f07cecf
17 files changed
+94
-80
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user