diff --git a/conf/wide.go b/conf/wide.go index 5e6384c..3ec8fee 100644 --- a/conf/wide.go +++ b/conf/wide.go @@ -183,7 +183,7 @@ func (*conf) GetExecutableInGOBIN(executable string) string { executable += ".exe" } - gopaths := strings.Split(os.Getenv("GOPATH"), PathListSeparator) + gopaths := filepath.SplitList(os.Getenv("GOPATH")) for _, gopath := range gopaths { // $GOPATH/bin/$GOOS_$GOARCH/executable @@ -280,10 +280,10 @@ func Load() { // // 如果不存在 Workspace 配置所指定的目录路径则创建该目录. func initWorkspaceDirs() { - paths := strings.Split(Wide.GetWorkspace(), PathListSeparator) + paths := filepath.SplitList(Wide.GetWorkspace()) for _, user := range Wide.Users { - paths = append(paths, strings.Split(user.GetWorkspace(), PathListSeparator)...) + paths = append(paths, filepath.SplitList(user.GetWorkspace())...) } diff --git a/editor/editors.go b/editor/editors.go index 85514b0..f5a21b9 100644 --- a/editor/editors.go +++ b/editor/editors.go @@ -7,6 +7,7 @@ import ( "net/http" "os" "os/exec" + "path/filepath" "runtime" "strconv" "strings" @@ -124,7 +125,7 @@ func AutocompleteHandler(w http.ResponseWriter, r *http.Request) { // glog.Infof("offset: %d", offset) userWorkspace := conf.Wide.GetUserWorkspace(username) - workspaces := strings.Split(userWorkspace, conf.PathListSeparator) + workspaces := filepath.SplitList(userWorkspace) libPath := "" for _, workspace := range workspaces { userLib := workspace + conf.PathSeparator + "pkg" + conf.PathSeparator + diff --git a/file/files.go b/file/files.go index 1e1bd28..14b679a 100644 --- a/file/files.go +++ b/file/files.go @@ -46,7 +46,7 @@ func GetFiles(w http.ResponseWriter, r *http.Request) { username := session.Values["username"].(string) userWorkspace := conf.Wide.GetUserWorkspace(username) - workspaces := strings.Split(userWorkspace, conf.PathListSeparator) + workspaces := filepath.SplitList(userWorkspace) root := FileNode{Name: "root", Path: "", IconSkin: "ico-ztree-dir ", Type: "d", FileNodes: []*FileNode{}}