Skip to content

gateway generation issue on windows #911

Closed
@Emixam23

Description

@Emixam23

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}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions