Create a symbol link file named protoc-gen-goctl from goctl (#1076)

This commit is contained in:
anqiansong
2021-09-21 23:13:31 +08:00
committed by GitHub
parent 06e114e5a3
commit e8a340c1c0
10 changed files with 135 additions and 83 deletions

View File

@@ -23,7 +23,9 @@ type (
MarkDone()
Must(err error)
}
colorConsole struct{}
// for idea log
ideaConsole struct{}
)
@@ -140,3 +142,37 @@ func println(msg interface{}) {
fmt.Println(msg)
}
var defaultConsole = new(colorConsole)
func Success(format string, a ...interface{}) {
defaultConsole.Success(format, a...)
}
func Info(format string, a ...interface{}) {
defaultConsole.Info(format, a...)
}
func Debug(format string, a ...interface{}) {
defaultConsole.Debug(format, a...)
}
func Warning(format string, a ...interface{}) {
defaultConsole.Warning(format, a...)
}
func Error(format string, a ...interface{}) {
defaultConsole.Error(format, a...)
}
func Fatalln(format string, a ...interface{}) {
defaultConsole.Fatalln(format, a...)
}
func MarkDone() {
defaultConsole.MarkDone()
}
func Must(err error) {
defaultConsole.Must(err)
}

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"
binProtocGenGoctl = "protoc-gen-goctl"
)
// LookUpGo searches an executable go in the directories
@@ -38,14 +39,22 @@ func LookUpProtoc() (string, error) {
return LookPath(xProtoc)
}
// LookUpProtocGenGo searches an executable protoc-gen-go in the directories
// named by the PATH environment variable.
// Deprecated: LookUpProtocGenGo searches an executable protoc-gen-go in the directories
// named by the PATH environment variable, use LookUpProtocGenGoctl instead.
func LookUpProtocGenGo() (string, error) {
suffix := getExeSuffix()
xProtocGenGo := binProtocGenGo + suffix
return LookPath(xProtocGenGo)
}
// LookUpProtocGenGoctl searches an executable protoc-gen-go in the directories
// named by the PATH environment variable.
func LookUpProtocGenGoctl() (string, error) {
suffix := getExeSuffix()
xProtocGenGo := binProtocGenGoctl + suffix
return LookPath(xProtocGenGo)
}
// 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