Skip to content

Add support for Go features (features.(pb.go).*) in buf#4363

Open
NexZhu wants to merge 1 commit intobufbuild:mainfrom
daotl:feat/go-features
Open

Add support for Go features (features.(pb.go).*) in buf#4363
NexZhu wants to merge 1 commit intobufbuild:mainfrom
daotl:feat/go-features

Conversation

@NexZhu
Copy link

@NexZhu NexZhu commented Mar 2, 2026

This commit adds support for configuring Go features in buf.yaml for managed mode code generation and breaking change detection.

Changes:

  • Add ResolveGoFeature and ResolveGoFeatureForEnum functions in customfeatures
  • Add FIELD_SAME_GO_STRIP_ENUM_PREFIX breaking change rule
  • Add FileOptionGoApiLevel for managed mode (features.(pb.go).api_level)
  • Add test for ResolveGoFeature

The Go features use the external google.golang.org/protobuf/types/gofeaturespb package to avoid namespace conflicts.

Note: The strip_enum_prefix breaking rule test is skipped as it requires edition 2024 which is not yet fully supported in buf.

@CLAassistant
Copy link

CLAassistant commented Mar 2, 2026

CLA assistant check
All committers have signed the CLA.

@NexZhu NexZhu force-pushed the feat/go-features branch from afcda35 to 450060f Compare March 2, 2026 07:23
This commit adds support for configuring Go features in buf.yaml for
managed mode code generation and breaking change detection.

Changes:
- Add ResolveGoFeature and ResolveGoFeatureForEnum functions in customfeatures
- Add FIELD_SAME_GO_STRIP_ENUM_PREFIX breaking change rule
- Add FileOptionGoApiLevel for managed mode (features.(pb.go).api_level)
- Add test for ResolveGoFeature

The Go features use the external google.golang.org/protobuf/types/gofeaturespb
package to avoid namespace conflicts.

Note: The strip_enum_prefix breaking rule test is skipped as it requires
edition 2024 which is not yet fully supported in buf.
@NexZhu NexZhu force-pushed the feat/go-features branch from 450060f to e871516 Compare March 2, 2026 07:25
@doriable
Copy link
Member

doriable commented Mar 2, 2026

Thank you for submitting this change -- I think this request seems very reasonable. Internally, our current priority is getting Editions 2024 support up and running with our new compiler, and would prefer to review this when it can be completed with the required tests. So transparently, I won't be able to review this until that body of work is complete, but if it is okay with you, I am happy to keep this PR open and will provide feedback once we are ready to accept this request.

@NexZhu
Copy link
Author

NexZhu commented Mar 3, 2026

Thank you for submitting this change -- I think this request seems very reasonable. Internally, our current priority is getting Editions 2024 support up and running with our new compiler, and would prefer to review this when it can be completed with the required tests. So transparently, I won't be able to review this until that body of work is complete, but if it is okay with you, I am happy to keep this PR open and will provide feedback once we are ready to accept this request.

Sure

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.

3 participants