Skip to content

Add go_package option to all proto files - #14

Closed
cafanasyev wants to merge 2 commits into
dstl:mainfrom
cafanasyev:go_declaration
Closed

Add go_package option to all proto files#14
cafanasyev wants to merge 2 commits into
dstl:mainfrom
cafanasyev:go_declaration

Conversation

@cafanasyev

Copy link
Copy Markdown

protoc-gen-go refuses to generate code for files without a go_package option, so the protos currently cannot be compiled for Go.

This PR adds a go_package option to every .proto file, wrapped in // [START go_declaration] / // [END go_declaration] tags to mirror the existing java_declaration blocks. The import paths follow the repository layout (e.g. github.com/dstl/SAPIENT-Proto-Files/sapient_msg/bsi_flex_335_v2_0;bsiflex335v2). No message definitions are changed.

With this, Go code for both versions generates out of the box:

protoc -I . --go_out=./out --go_opt=paths=source_relative \                                                                                                                                                              
      sapient_msg/proto_options.proto sapient_msg/bsi_flex_335_v1_0/*.proto sapient_msg/bsi_flex_335_v2_0/*.proto

@cafanasyev cafanasyev closed this Jul 13, 2026
@cafanasyev

Copy link
Copy Markdown
Author

requires #13 first

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

Successfully merging this pull request may close these issues.

1 participant