If you make changes to .proto files, you will need to rebuild the generated Go code. You may also need to rebuild the generated code if the required versions of the google.golang.org/protobuf or google.golang.org/grpc modules defined in go.mod change.
First, follow this one-time setup:
- Download the protobuf compiler.
The simplest approach is to download one of the prebuilt binaries (named
protoc
) and extract it somewhere in your machine's$PATH
.
To generate the code:
- Navigate to this directory (
pkg/beam/model
). - Check go.mod and make note of which versions of google.golang.org/protobuf and google.golang.org/grpc are required.
- Verify the versions in ../../../scripts/genproto.sh are correct
go generate
If the generated .pb.go code contains build errors, it indicates a version
mismatch somewhere between the packages required in go.mod, the installed Go
executables, and the prebuilt protoc
binary (which should match the
google.golang.org/protobuf version). Following the steps above with matching
version numbers should fix the error.