diff --git a/tool/kratos/tool.go b/tool/kratos/tool.go index c42ce6828..3b410d4c9 100644 --- a/tool/kratos/tool.go +++ b/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] }