mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-17 21:07:54 +02:00
find other gopath need compatible with windows
This commit is contained in:
parent
676cbb15a8
commit
6108084a4a
@ -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…
x
Reference in New Issue
Block a user