-
Notifications
You must be signed in to change notification settings - Fork 286
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
import error resulting from /google/api #3500
Comments
Hello, so your problem is that your generated code attempts to import You have two options to fix your build: Option 1: The recommended method is to exclude
What this is saying is that the
This uses the publicly available Option 2: If you want to generate the code for
And an import statement that now makes sense:
However, it is recommended that you use the managed package for Also, something to note about your |
thanks a lot! i tried adding an |
Nice, I'm glad it worked out :) |
GitHub repository with your minimal reproducible example (do not leave this field blank or fill out this field with "github.com/bufbuild/buf" or we will automatically close your issue, see the instructions above!)
https://github.com/tobby-s/buf-import-error-example/
Commands
buf generate .
Output
no output, command runs without errors, but the import generated in generated/minimal-example/minimal/example/v1/ex.pb.go has an unusual import on line 10 that doesn't do anything, but prevents the code from building
Expected Output
golang code that can compile
Anything else?
the proto was written by someone other than me (i reduced it to a minimal example), i'm not experienced with using stuff like annotations and have no context on why it was used or whether it's written correctly. i just want to fix the generated code so i can import it and work on integrating with it.
it's entirely possible that there's an issue with how the imports are used, so if there is a fix that involves changing how the proto file is specified i'm open to it (i'd even be happier about it because i wouldn't have to wait for a bugfix+release).
notably, other generated code from other teams that use
protoc
directlly with the--go_out
and--grpc-gateway_out
flags don't have this erroneous import.The text was updated successfully, but these errors were encountered: