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 <lassefolger@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
diff --git a/internal/cmd/generate-protos/main.go b/internal/cmd/generate-protos/main.go
index 6f43a09..b2d0803 100644
--- a/internal/cmd/generate-protos/main.go
+++ b/internal/cmd/generate-protos/main.go
@@ -293,7 +293,7 @@
// 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 9a652a2..546388c 100644
--- a/internal/genid/go_features_gen.go
+++ b/internal/genid/go_features_gen.go
@@ -12,20 +12,20 @@
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
)