Open linghunjiushu opened 4 years ago
使用 github.com/micro/go-micro/v2 github.com/micro/protoc-gen-micro/v2
micro new --type=api xxx
在xxx目录下执行 make proto 生成的 xxx.pb.micro.go `import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" proto1 "proto" )
import ( context "context" client "github.com/micro/go-micro/v2/client" server "github.com/micro/go-micro/v2/server" )`
再执行 go run main.go, 报错 proto/xxx/xxx.pb.go:10:2: package proto is not in GOROOT
proto/xxx/xxx.pb.go:10:2: package proto is not in GOROOT
发下你的proto文件
使用 github.com/micro/go-micro/v2 github.com/micro/protoc-gen-micro/v2
micro new --type=api xxx
在xxx目录下执行 make proto 生成的 xxx.pb.micro.go `import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" proto1 "proto" )
import ( context "context" client "github.com/micro/go-micro/v2/client" server "github.com/micro/go-micro/v2/server" )`
再执行 go run main.go, 报错
proto/xxx/xxx.pb.go:10:2: package proto is not in GOROOT