1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

获取GOBIN当不在GOPATH下的情况

This commit is contained in:
weisenhuang 2019-06-20 12:12:40 +08:00
parent 60c1b68039
commit a21511b2cf

View File

@ -174,7 +174,11 @@ func (t Tool) updated() bool {
}
func (t Tool) toolPath() string {
return filepath.Join(gopath(), "bin", t.Alias)
if gobin := os.Getenv("GOBIN");len(gobin) > 0 {
return filepath.Join(gobin, t.Alias)
}else{
return filepath.Join(gopath(), "bin", t.Alias)
}
}
func (t Tool) installed() bool {