Add --go_opt flag to adapt to the version after 1.4.0 of protoc-gen-go (#767)

Co-authored-by: anqiansong <anqiansong@xiaoheiban.cn>
This commit is contained in:
anqiansong
2021-07-08 10:11:11 +08:00
committed by GitHub
parent 22a1315136
commit efdf475da4
8 changed files with 89 additions and 16 deletions

View File

@@ -11,8 +11,11 @@ type DefaultGenerator struct {
log console.Console
}
// just test interface implement
var _ Generator = (*DefaultGenerator)(nil)
// NewDefaultGenerator returns an instance of DefaultGenerator
func NewDefaultGenerator() *DefaultGenerator {
func NewDefaultGenerator() Generator {
log := console.NewColorConsole()
return &DefaultGenerator{
log: log,
@@ -33,5 +36,6 @@ func (g *DefaultGenerator) Prepare() error {
}
_, err = exec.LookPath("protoc-gen-go")
return err
}