Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gateway generation issue on windows #911

Closed
Emixam23 opened this issue Mar 19, 2019 · 1 comment
Closed

gateway generation issue on windows #911

Emixam23 opened this issue Mar 19, 2019 · 1 comment

Comments

@Emixam23
Copy link

Emixam23 commented Mar 19, 2019

I am running into an issue in Win10 when it comes to use the generated files:

GOROOT=D:\Go #gosetup
GOPATH=C:\Workspace\Project #gosetup
D:\Go\bin\go.exe build -i -o C:\Users\Max\AppData\Local\Temp\___NDP_users.exe C:/Workspace/Project/src/NDPs/users/v1/main.go #gosetup
# NDPs/users/v1/service
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:31:119: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:48:121: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:65:103: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:82:104: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:99:104: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:116:104: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:133:106: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:150:107: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:167:107: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:184:109: undefined: NDP_usersServiceClient
src\NDPs\users\v1\service\ndp_users_service.pb.gw.go:184:109: too many errors

I have a script that helps me to generate the files:

:: Generation line
protoc --proto_path . --proto_path %proto_file% %~2 -I%src%/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --swagger_out=logtostderr=true:%generation_output_path% --go_out=plugin=grpc:%generation_output_path% --grpc-gateway_out=logtostderr=true:%generation_output_path%

Everything gets generated:

  • ndp_users_service.pb.go
  • ndp_users_service.pb.gw.go
  • ndp_users_service.swagger.json

However, as I pointed before, the ServiceClient isn't generated, why? I would love to point that I am running my script through the terminal of Goland (windows 10)

Any idea?

PS: The generation works fine on my Mac via

protoc ${proto_file} -I/usr/local/include -I. -I${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --swagger_out=logtostderr=true:${generation_output_path} --go_out=plugins=grpc:${generation_output_path} --grpc-gateway_out=logtostderr=true:${generation_output_path}
@johanbrandhorst
Copy link
Collaborator

You need plugins=grpc, you've written plugin=grpc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants