package main import ( "os/exec" ) const ( _getEcodeGen = "go get -u github.com/go-kratos/kratos/tool/protobuf/protoc-gen-ecode" _ecodeProtoc = "protoc --proto_path=%s --proto_path=%s --proto_path=%s --ecode_out=" + "Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types," + "Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types," + "Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types," + "Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types," + "Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types:." ) func installEcodeGen() error { if _, err := exec.LookPath("protoc-gen-ecode"); err != nil { if err := goget(_getEcodeGen); err != nil { return err } } return nil } func genEcode(files []string) error { return generate(_ecodeProtoc, files) }