Skip to content

Instantly share code, notes, and snippets.

@terwey
Created October 31, 2022 15:25
Show Gist options
  • Save terwey/9797498c85465811582242cbabda27a8 to your computer and use it in GitHub Desktop.
Save terwey/9797498c85465811582242cbabda27a8 to your computer and use it in GitHub Desktop.
--grpc-gateway_out: 11:1: expected 'IDENT', found 'import'

If you ended up here because of the following error:

--grpc-gateway_out: 11:1: expected 'IDENT', found 'import'

And you noticed the generated Go code was missing the package name, it could be due to the way the go_package is declared.

This works for the go-grpc, if you want to generate it directly into a directory

option go_package = "pinger/";

However, the go-grpc-gateway does not like this.

This is a workaround:

option go_package = "pinger/;pinger";

However, the correct syntax is:

option go_package = "/pinger";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment