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>
This commit is contained in:
Michael Stapelberg 2024-07-31 15:13:48 +02:00
parent 219bda23ff
commit 2a82025330
2 changed files with 6 additions and 6 deletions

View File

@ -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
}

View File

@ -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
)