Feature: Add goctl env (#1557)
This commit is contained in:
17
tools/goctl/util/env/env.go
vendored
17
tools/goctl/util/env/env.go
vendored
@@ -11,10 +11,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
bin = "bin"
|
||||
binGo = "go"
|
||||
binProtoc = "protoc"
|
||||
binProtocGenGo = "protoc-gen-go"
|
||||
bin = "bin"
|
||||
binGo = "go"
|
||||
binProtoc = "protoc"
|
||||
binProtocGenGo = "protoc-gen-go"
|
||||
binProtocGenGrpcGo = "protoc-gen-go-grpc"
|
||||
)
|
||||
|
||||
// LookUpGo searches an executable go in the directories
|
||||
@@ -46,6 +47,14 @@ func LookUpProtocGenGo() (string, error) {
|
||||
return LookPath(xProtocGenGo)
|
||||
}
|
||||
|
||||
// LookUpProtocGenGoGrpc searches an executable protoc-gen-go-grpc in the directories
|
||||
// named by the PATH environment variable.
|
||||
func LookUpProtocGenGoGrpc() (string, error) {
|
||||
suffix := getExeSuffix()
|
||||
xProtocGenGoGrpc := binProtocGenGrpcGo + suffix
|
||||
return LookPath(xProtocGenGoGrpc)
|
||||
}
|
||||
|
||||
// LookPath searches for an executable named file in the
|
||||
// directories named by the PATH environment variable,
|
||||
// for the os windows, the named file will be spliced with the
|
||||
|
||||
Reference in New Issue
Block a user