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:
parent
60c1b68039
commit
a21511b2cf
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user