获取GOBIN当不在GOPATH下的情况

pull/169/head
weisenhuang 6 years ago
parent 60c1b68039
commit a21511b2cf
  1. 6
      tool/kratos/tool.go

@ -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…
Cancel
Save