kratos框架 demo build 错误

初次接触搞不定了 求帮助:

`⇒ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/jelty/Library/Caches/go-build"
GOENV="/Users/jelty/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/jelty/data/GoPath"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/Users/jelty/opt/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/Users/jelty/opt/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/jelty/data/GoPath/src/kratos-demo/go.mod"``

\kratos tool protoc --grpc --bm api.proto
2020/04/15 17:33:32 protoc --proto_path=/Users/jelty/data/GoPath/src --proto_path=/Users/jelty/data/GoPath/pkg/mod/github.com/go-kratos/kratos@v0.4.3-0.20200408075623-52cb7ec27f60/third_party --proto_path=/Users/jelty/data/GoPath/src/kratos-demo/api --bm_out=:. api.proto
api.proto: File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).
exit status 1
exit status 1
kratos tool genbts
Close: 无声明 忽略此方法
Ping: 无声明 忽略此方法
dao.bts.go: 生成成功
kratos tool genmc
mc.cache.go: 生成成功
kratos tool wire
wire: /Users/jelty/data/GoPath/src/kratos-demo/internal/service/service.go:15:33: first argument to Bind must be a pointer to an interface type; found
wire: kratos-demo/internal/di: generate failed
wire: at least one generate failure
exit status 1
kratos tool wire
wire: kratos-demo/internal/dao: wrote /Users/jelty/data/GoPath/src/kratos-demo/internal/dao/wire_gen.go
Project: kratos-demo
OnlyGRPC: false
OnlyHTTP: false
Directory: /Users/jelty/data/GoPath/src/kratos-demo

项目创建成功.`

jelty@jeltydeMBP:~/data/GoPath/src/kratos-demo/cmd|
⇒ go build
kratos-demo/api

../api/client.go:15:68: undefined: DemoClient
../api/client.go:21:9: undefined: NewDemoClient

jelty@jeltydeMacBook-Pro:~/data/GoPath/src/kratos-demo|
⇒ kratos-protoc api/api.proto
2020/04/16 11:27:31 protoc --proto_path=/Users/jelty/data/GoPath/src --proto_path=/Users/jelty/data/GoPath/pkg/mod/github.com/go-kratos/kratos@v0.4.3-0.20200408075623-52cb7ec27f60/third_party --proto_path=/Users/jelty/data/GoPath/src/kratos-demo --bm_out=:. api/api.proto
api/api.proto: File does not reside within any path specified using --proto_path (or -I). You must specify a --proto_path which encompasses this file. Note that the proto_path must be an exact prefix of the .proto file names -- protoc is too dumb to figure out when two paths (e.g. absolute and relative) are equivalent (it's harder than you think).
exit status 1

阅读 2.1k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题