mirror of
https://github.com/go-kratos/kratos.git
synced 2025-01-10 00:29:01 +02:00
improve get gopaths
This commit is contained in:
parent
230a63771d
commit
0fc38dd40f
@ -144,14 +144,7 @@ func latestKratos() (string, error) {
|
||||
}
|
||||
|
||||
func gopath() (gp string) {
|
||||
var gopaths []string
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
gopaths = strings.Split(os.Getenv("GOPATH"), ";")
|
||||
default:
|
||||
gopaths = strings.Split(os.Getenv("GOPATH"), ":")
|
||||
}
|
||||
gopaths := strings.Split(os.Getenv("GOPATH"), string(filepath.ListSeparator))
|
||||
|
||||
if len(gopaths) == 1 && gopaths[0] != "" {
|
||||
return gopaths[0]
|
||||
|
@ -186,14 +186,7 @@ func (t Tool) installed() bool {
|
||||
}
|
||||
|
||||
func gopath() (gp string) {
|
||||
var gopaths []string
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
gopaths = strings.Split(os.Getenv("GOPATH"), ";")
|
||||
default:
|
||||
gopaths = strings.Split(os.Getenv("GOPATH"), ":")
|
||||
}
|
||||
gopaths := strings.Split(os.Getenv("GOPATH"), string(filepath.ListSeparator))
|
||||
|
||||
if len(gopaths) == 1 && gopaths[0] != "" {
|
||||
return gopaths[0]
|
||||
|
Loading…
Reference in New Issue
Block a user