Feature: Add goctl env (#1557)

This commit is contained in:
anqiansong
2022-02-21 10:19:33 +08:00
committed by GitHub
parent 842656aa90
commit daa98f5a27
18 changed files with 1180 additions and 27 deletions

View File

@@ -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