From 2a82025330a7f0b0020fe64763d84d16e68673bc Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 31 Jul 2024 15:13:48 +0200 Subject: [PATCH] internal/cmd/generate-protos: fix pkg check for editions features go_features.proto apparently lived in package google.protobuf, but was later moved to package pb, without updating generate-protos. This change fixes the oversight and re-generates go_features_gen.go. Change-Id: I6fd68fdb7b146f32dd610c0bad6ecf5ec940ae78 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/602055 Reviewed-by: Lasse Folger LUCI-TryBot-Result: Go LUCI --- internal/cmd/generate-protos/main.go | 2 +- internal/genid/go_features_gen.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/cmd/generate-protos/main.go b/internal/cmd/generate-protos/main.go index 6f43a09b..b2d0803c 100644 --- a/internal/cmd/generate-protos/main.go +++ b/internal/cmd/generate-protos/main.go @@ -293,7 +293,7 @@ func protoc(args ...string) { // generateIdentifiers generates an internal package for descriptor.proto // and well-known types. func generateIdentifiers(gen *protogen.Plugin, file *protogen.File) { - if file.Desc.Package() != "google.protobuf" { + if file.Desc.Package() != "google.protobuf" && file.Desc.Package() != "pb" { return } diff --git a/internal/genid/go_features_gen.go b/internal/genid/go_features_gen.go index 9a652a2b..546388c4 100644 --- a/internal/genid/go_features_gen.go +++ b/internal/genid/go_features_gen.go @@ -12,20 +12,20 @@ import ( const File_google_protobuf_go_features_proto = "google/protobuf/go_features.proto" -// Names for google.protobuf.GoFeatures. +// Names for pb.GoFeatures. const ( GoFeatures_message_name protoreflect.Name = "GoFeatures" - GoFeatures_message_fullname protoreflect.FullName = "google.protobuf.GoFeatures" + GoFeatures_message_fullname protoreflect.FullName = "pb.GoFeatures" ) -// Field names for google.protobuf.GoFeatures. +// Field names for pb.GoFeatures. const ( GoFeatures_LegacyUnmarshalJsonEnum_field_name protoreflect.Name = "legacy_unmarshal_json_enum" - GoFeatures_LegacyUnmarshalJsonEnum_field_fullname protoreflect.FullName = "google.protobuf.GoFeatures.legacy_unmarshal_json_enum" + GoFeatures_LegacyUnmarshalJsonEnum_field_fullname protoreflect.FullName = "pb.GoFeatures.legacy_unmarshal_json_enum" ) -// Field numbers for google.protobuf.GoFeatures. +// Field numbers for pb.GoFeatures. const ( GoFeatures_LegacyUnmarshalJsonEnum_field_number protoreflect.FieldNumber = 1 )