find other gopath need compatible with windows

pull/349/head
vanex 5 years ago
parent 676cbb15a8
commit 6108084a4a
  1. 10
      tool/kratos/tool.go

@ -186,7 +186,15 @@ func (t Tool) installed() bool {
}
func gopath() (gp string) {
gopaths := strings.Split(os.Getenv("GOPATH"), ":")
var gopaths []string
switch runtime.GOOS {
case "windows":
gopaths = strings.Split(os.Getenv("GOPATH"), ";")
default:
gopaths = strings.Split(os.Getenv("GOPATH"), ":")
}
if len(gopaths) == 1 && gopaths[0] != "" {
return gopaths[0]
}

Loading…
Cancel
Save