Aaron Gable has uploaded this change for review.
cmd/protoc-gen-go: Format OneOf assignable types as a list
Go 1.19 has added semantic understanding and formatting of doc comments.
It uses various heuristics to determine what kind of content any given
line of a comment is, and then enforces formatting based on that.
Currently, the doc comment above OneOf fields in message structs lists
the values that it can take each on their own line, preceded by a
literal tab character. However, in go1.19, indenting a line of a doc
comment with a tab character causes it to believe that the line should
be part of a code block. And according to its formatting rules, code
blocks must be preceded and followed by blank lines. This causes
go1.19's gofmt to insert an empty line between the "Types that are
assignable to..." text and the set of types.
But semantically, the set of types that can be assigned to a OneOf field
is not a code block, it's a list. So this change slightly modifies the
format of the text to indicate to gofmt that the lines are a list.
Change-Id: Iae319bebdc03f3e56490f96f16ab1ba29ecca63f
---
M cmd/protoc-gen-go/internal_gengo/main.go
M cmd/protoc-gen-go/testdata/comments/comments.pb.go
M cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
M cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
M cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
M cmd/protoc-gen-go/testdata/proto2/fields.pb.go
M internal/testprotos/conformance/conformance.pb.go
M internal/testprotos/conformance/test_messages_proto2.pb.go
M internal/testprotos/conformance/test_messages_proto3.pb.go
M internal/testprotos/irregular/test.pb.go
M internal/testprotos/order/order.pb.go
M internal/testprotos/test/test.pb.go
M internal/testprotos/test3/test.pb.go
M internal/testprotos/textpb2/test.pb.go
M internal/testprotos/textpb3/test.pb.go
M types/known/structpb/struct.pb.go
16 files changed, 130 insertions(+), 107 deletions(-)
diff --git a/cmd/protoc-gen-go/internal_gengo/main.go b/cmd/protoc-gen-go/internal_gengo/main.go
index d34efa9..f3d0cdf 100644
--- a/cmd/protoc-gen-go/internal_gengo/main.go
+++ b/cmd/protoc-gen-go/internal_gengo/main.go
@@ -387,7 +387,7 @@
}
ss := []string{fmt.Sprintf(" Types that are assignable to %s:\n", oneof.GoName)}
for _, field := range oneof.Fields {
- ss = append(ss, "\t*"+field.GoIdent.GoName+"\n")
+ ss = append(ss, " - *"+field.GoIdent.GoName+"\n")
}
leadingComments += protogen.Comments(strings.Join(ss, ""))
g.P(leadingComments,
diff --git a/cmd/protoc-gen-go/testdata/comments/comments.pb.go b/cmd/protoc-gen-go/testdata/comments/comments.pb.go
index 5b3fcf4..8a06494 100644
--- a/cmd/protoc-gen-go/testdata/comments/comments.pb.go
+++ b/cmd/protoc-gen-go/testdata/comments/comments.pb.go
@@ -87,7 +87,7 @@
// COMMENT: Oneof1A.Leading
//
// Types that are assignable to Oneof1A:
- // *Message1_Oneof1AField1
+ // - *Message1_Oneof1AField1
Oneof1A isMessage1_Oneof1A `protobuf_oneof:"Oneof1a"`
}
diff --git a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
index ed3e0db..e85252e 100644
--- a/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
+++ b/cmd/protoc-gen-go/testdata/fieldnames/fieldnames.pb.go
@@ -45,18 +45,18 @@
// Oneof that conflicts with its first field: The oneof is renamed.
//
// Types that are assignable to OneofConflictA_:
- // *Message_OneofConflictA
+ // - *Message_OneofConflictA
OneofConflictA_ isMessage_OneofConflictA_ `protobuf_oneof:"oneof_conflict_a"`
// Oneof that conflicts with its second field: The field is renamed.
//
// Types that are assignable to OneofConflictB:
- // *Message_OneofNoConflict
- // *Message_OneofConflictB_
+ // - *Message_OneofNoConflict
+ // - *Message_OneofConflictB_
OneofConflictB isMessage_OneofConflictB `protobuf_oneof:"oneof_conflict_b"`
// Oneof with a field name that conflicts with a nested message.
//
// Types that are assignable to OneofConflictC:
- // *Message_OneofMessageConflict_
+ // - *Message_OneofMessageConflict_
OneofConflictC isMessage_OneofConflictC `protobuf_oneof:"oneof_conflict_c"`
}
diff --git a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
index d0897db..8ca0e84 100644
--- a/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
+++ b/cmd/protoc-gen-go/testdata/import_public/sub/a.pb.go
@@ -191,8 +191,8 @@
B []byte `protobuf:"bytes,5,opt,name=b,def=default" json:"b,omitempty"`
F *float64 `protobuf:"fixed64,6,opt,name=f,def=nan" json:"f,omitempty"`
// Types that are assignable to OneofField:
- // *M_OneofInt32
- // *M_OneofInt64
+ // - *M_OneofInt32
+ // - *M_OneofInt64
OneofField isM_OneofField `protobuf_oneof:"oneof_field"`
}
@@ -310,8 +310,8 @@
unknownFields protoimpl.UnknownFields
// Types that are assignable to SubmessageOneofField:
- // *M_Submessage_SubmessageOneofInt32
- // *M_Submessage_SubmessageOneofInt64
+ // - *M_Submessage_SubmessageOneofInt32
+ // - *M_Submessage_SubmessageOneofInt64
SubmessageOneofField isM_Submessage_SubmessageOneofField `protobuf_oneof:"submessage_oneof_field"`
}
diff --git a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
index e4164c5..b8204fd 100644
--- a/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
+++ b/cmd/protoc-gen-go/testdata/issue780_oneof_conflict/test.pb.go
@@ -20,7 +20,7 @@
unknownFields protoimpl.UnknownFields
// Types that are assignable to Bar:
- // *Foo_GetBar
+ // - *Foo_GetBar
Bar isFoo_Bar `protobuf_oneof:"bar"`
}
diff --git a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
index bb979ac..34fe2db 100644
--- a/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
+++ b/cmd/protoc-gen-go/testdata/proto2/fields.pb.go
@@ -158,29 +158,29 @@
MapStringMessage map[string]*FieldTestMessage_Message `protobuf:"bytes,501,rep,name=map_string_message,json=mapStringMessage" json:"map_string_message,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
MapFixed64Enum map[uint64]FieldTestMessage_Enum `protobuf:"bytes,502,rep,name=map_fixed64_enum,json=mapFixed64Enum" json:"map_fixed64_enum,omitempty" protobuf_key:"fixed64,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=goproto.protoc.proto2.FieldTestMessage_Enum"`
// Types that are assignable to OneofField:
- // *FieldTestMessage_OneofBool
- // *FieldTestMessage_OneofEnum
- // *FieldTestMessage_OneofInt32
- // *FieldTestMessage_OneofSint32
- // *FieldTestMessage_OneofUint32
- // *FieldTestMessage_OneofInt64
- // *FieldTestMessage_OneofSint64
- // *FieldTestMessage_OneofUint64
- // *FieldTestMessage_OneofSfixed32
- // *FieldTestMessage_OneofFixed32
- // *FieldTestMessage_OneofFloat
- // *FieldTestMessage_OneofSfixed64
- // *FieldTestMessage_OneofFixed64
- // *FieldTestMessage_OneofDouble
- // *FieldTestMessage_OneofString
- // *FieldTestMessage_OneofBytes
- // *FieldTestMessage_Oneof_Message
- // *FieldTestMessage_Oneofgroup
- // *FieldTestMessage_OneofLargestTag
+ // - *FieldTestMessage_OneofBool
+ // - *FieldTestMessage_OneofEnum
+ // - *FieldTestMessage_OneofInt32
+ // - *FieldTestMessage_OneofSint32
+ // - *FieldTestMessage_OneofUint32
+ // - *FieldTestMessage_OneofInt64
+ // - *FieldTestMessage_OneofSint64
+ // - *FieldTestMessage_OneofUint64
+ // - *FieldTestMessage_OneofSfixed32
+ // - *FieldTestMessage_OneofFixed32
+ // - *FieldTestMessage_OneofFloat
+ // - *FieldTestMessage_OneofSfixed64
+ // - *FieldTestMessage_OneofFixed64
+ // - *FieldTestMessage_OneofDouble
+ // - *FieldTestMessage_OneofString
+ // - *FieldTestMessage_OneofBytes
+ // - *FieldTestMessage_Oneof_Message
+ // - *FieldTestMessage_Oneofgroup
+ // - *FieldTestMessage_OneofLargestTag
OneofField isFieldTestMessage_OneofField `protobuf_oneof:"oneof_field"`
// Types that are assignable to OneofTwo:
- // *FieldTestMessage_OneofTwo_1
- // *FieldTestMessage_OneofTwo_2
+ // - *FieldTestMessage_OneofTwo_1
+ // - *FieldTestMessage_OneofTwo_2
OneofTwo isFieldTestMessage_OneofTwo `protobuf_oneof:"oneof_two"`
}
diff --git a/internal/testprotos/conformance/conformance.pb.go b/internal/testprotos/conformance/conformance.pb.go
index fcdeb2b..e24cd9e 100644
--- a/internal/testprotos/conformance/conformance.pb.go
+++ b/internal/testprotos/conformance/conformance.pb.go
@@ -213,9 +213,9 @@
// Represents a single test case's input. The testee should:
//
-// 1. parse this proto (which should always succeed)
-// 2. parse the protobuf or JSON payload in "payload" (which may fail)
-// 3. if the parse succeeded, serialize the message in the requested format.
+// 1. parse this proto (which should always succeed)
+// 2. parse the protobuf or JSON payload in "payload" (which may fail)
+// 3. if the parse succeeded, serialize the message in the requested format.
type ConformanceRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -230,10 +230,10 @@
// protobuf_test_messages.proto2.TestAllTypes message instead.
//
// Types that are assignable to Payload:
- // *ConformanceRequest_ProtobufPayload
- // *ConformanceRequest_JsonPayload
- // *ConformanceRequest_JspbPayload
- // *ConformanceRequest_TextPayload
+ // - *ConformanceRequest_ProtobufPayload
+ // - *ConformanceRequest_JsonPayload
+ // - *ConformanceRequest_JspbPayload
+ // - *ConformanceRequest_TextPayload
Payload isConformanceRequest_Payload `protobuf_oneof:"payload"`
// Which format should the testee serialize its message to?
RequestedOutputFormat WireFormat `protobuf:"varint,3,opt,name=requested_output_format,json=requestedOutputFormat,proto3,enum=conformance.WireFormat" json:"requested_output_format,omitempty"`
@@ -390,14 +390,14 @@
unknownFields protoimpl.UnknownFields
// Types that are assignable to Result:
- // *ConformanceResponse_ParseError
- // *ConformanceResponse_SerializeError
- // *ConformanceResponse_RuntimeError
- // *ConformanceResponse_ProtobufPayload
- // *ConformanceResponse_JsonPayload
- // *ConformanceResponse_Skipped
- // *ConformanceResponse_JspbPayload
- // *ConformanceResponse_TextPayload
+ // - *ConformanceResponse_ParseError
+ // - *ConformanceResponse_SerializeError
+ // - *ConformanceResponse_RuntimeError
+ // - *ConformanceResponse_ProtobufPayload
+ // - *ConformanceResponse_JsonPayload
+ // - *ConformanceResponse_Skipped
+ // - *ConformanceResponse_JspbPayload
+ // - *ConformanceResponse_TextPayload
Result isConformanceResponse_Result `protobuf_oneof:"result"`
}
diff --git a/internal/testprotos/conformance/test_messages_proto2.pb.go b/internal/testprotos/conformance/test_messages_proto2.pb.go
index 78298d7..6044c62 100644
--- a/internal/testprotos/conformance/test_messages_proto2.pb.go
+++ b/internal/testprotos/conformance/test_messages_proto2.pb.go
@@ -277,15 +277,15 @@
MapStringNestedEnum map[string]TestAllTypesProto2_NestedEnum `protobuf:"bytes,73,rep,name=map_string_nested_enum,json=mapStringNestedEnum" json:"map_string_nested_enum,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=protobuf_test_messages.proto2.TestAllTypesProto2_NestedEnum"`
MapStringForeignEnum map[string]ForeignEnumProto2 `protobuf:"bytes,74,rep,name=map_string_foreign_enum,json=mapStringForeignEnum" json:"map_string_foreign_enum,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value,enum=protobuf_test_messages.proto2.ForeignEnumProto2"`
// Types that are assignable to OneofField:
- // *TestAllTypesProto2_OneofUint32
- // *TestAllTypesProto2_OneofNestedMessage
- // *TestAllTypesProto2_OneofString
- // *TestAllTypesProto2_OneofBytes
- // *TestAllTypesProto2_OneofBool
- // *TestAllTypesProto2_OneofUint64
- // *TestAllTypesProto2_OneofFloat
- // *TestAllTypesProto2_OneofDouble
- // *TestAllTypesProto2_OneofEnum
+ // - *TestAllTypesProto2_OneofUint32
+ // - *TestAllTypesProto2_OneofNestedMessage
+ // - *TestAllTypesProto2_OneofString
+ // - *TestAllTypesProto2_OneofBytes
+ // - *TestAllTypesProto2_OneofBool
+ // - *TestAllTypesProto2_OneofUint64
+ // - *TestAllTypesProto2_OneofFloat
+ // - *TestAllTypesProto2_OneofDouble
+ // - *TestAllTypesProto2_OneofEnum
OneofField isTestAllTypesProto2_OneofField `protobuf_oneof:"oneof_field"`
Data *TestAllTypesProto2_Data `protobuf:"group,201,opt,name=Data,json=data" json:"data,omitempty"`
// Test field-name-to-JSON-name convention.
diff --git a/internal/testprotos/conformance/test_messages_proto3.pb.go b/internal/testprotos/conformance/test_messages_proto3.pb.go
index 8387873..4ff1003 100644
--- a/internal/testprotos/conformance/test_messages_proto3.pb.go
+++ b/internal/testprotos/conformance/test_messages_proto3.pb.go
@@ -321,16 +321,16 @@
MapStringNestedEnum map[string]TestAllTypesProto3_NestedEnum `protobuf:"bytes,73,rep,name=map_string_nested_enum,json=mapStringNestedEnum,proto3" json:"map_string_nested_enum,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=protobuf_test_messages.proto3.TestAllTypesProto3_NestedEnum"`
MapStringForeignEnum map[string]ForeignEnum `protobuf:"bytes,74,rep,name=map_string_foreign_enum,json=mapStringForeignEnum,proto3" json:"map_string_foreign_enum,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=protobuf_test_messages.proto3.ForeignEnum"`
// Types that are assignable to OneofField:
- // *TestAllTypesProto3_OneofUint32
- // *TestAllTypesProto3_OneofNestedMessage
- // *TestAllTypesProto3_OneofString
- // *TestAllTypesProto3_OneofBytes
- // *TestAllTypesProto3_OneofBool
- // *TestAllTypesProto3_OneofUint64
- // *TestAllTypesProto3_OneofFloat
- // *TestAllTypesProto3_OneofDouble
- // *TestAllTypesProto3_OneofEnum
- // *TestAllTypesProto3_OneofNullValue
+ // - *TestAllTypesProto3_OneofUint32
+ // - *TestAllTypesProto3_OneofNestedMessage
+ // - *TestAllTypesProto3_OneofString
+ // - *TestAllTypesProto3_OneofBytes
+ // - *TestAllTypesProto3_OneofBool
+ // - *TestAllTypesProto3_OneofUint64
+ // - *TestAllTypesProto3_OneofFloat
+ // - *TestAllTypesProto3_OneofDouble
+ // - *TestAllTypesProto3_OneofEnum
+ // - *TestAllTypesProto3_OneofNullValue
OneofField isTestAllTypesProto3_OneofField `protobuf_oneof:"oneof_field"`
// Well-known types
OptionalBoolWrapper *wrapperspb.BoolValue `protobuf:"bytes,201,opt,name=optional_bool_wrapper,json=optionalBoolWrapper,proto3" json:"optional_bool_wrapper,omitempty"`
diff --git a/internal/testprotos/irregular/test.pb.go b/internal/testprotos/irregular/test.pb.go
index 6a323a4..983dfc4 100644
--- a/internal/testprotos/irregular/test.pb.go
+++ b/internal/testprotos/irregular/test.pb.go
@@ -28,8 +28,8 @@
RequiredMessage *IrregularMessage `protobuf:"bytes,3,req,name=required_message,json=requiredMessage" json:"required_message,omitempty"`
MapMessage map[string]*IrregularMessage `protobuf:"bytes,4,rep,name=map_message,json=mapMessage" json:"map_message,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// Types that are assignable to Union:
- // *Message_OneofMessage
- // *Message_OneofAberrantMessage
+ // - *Message_OneofMessage
+ // - *Message_OneofAberrantMessage
Union isMessage_Union `protobuf_oneof:"union"`
OptionalAberrantMessage *AberrantMessage `protobuf:"bytes,7,opt,name=optional_aberrant_message,json=optionalAberrantMessage" json:"optional_aberrant_message,omitempty"`
RepeatedAberrantMessage []*AberrantMessage `protobuf:"bytes,8,rep,name=repeated_aberrant_message,json=repeatedAberrantMessage" json:"repeated_aberrant_message,omitempty"`
diff --git a/internal/testprotos/order/order.pb.go b/internal/testprotos/order/order.pb.go
index 0d7482b..939e901 100644
--- a/internal/testprotos/order/order.pb.go
+++ b/internal/testprotos/order/order.pb.go
@@ -25,7 +25,7 @@
Field_2 *string `protobuf:"bytes,2,opt,name=field_2,json=field2" json:"field_2,omitempty"`
Field_1 *string `protobuf:"bytes,1,opt,name=field_1,json=field1" json:"field_1,omitempty"`
// Types that are assignable to Oneof_1:
- // *Message_Field_10
+ // - *Message_Field_10
Oneof_1 isMessage_Oneof_1 `protobuf_oneof:"oneof_1"`
Field_20 *string `protobuf:"bytes,20,opt,name=field_20,json=field20" json:"field_20,omitempty"`
}
diff --git a/internal/testprotos/test/test.pb.go b/internal/testprotos/test/test.pb.go
index 4263ff9..a186953 100644
--- a/internal/testprotos/test/test.pb.go
+++ b/internal/testprotos/test/test.pb.go
@@ -330,21 +330,21 @@
DefaultNestedEnum *TestAllTypes_NestedEnum `protobuf:"varint,96,opt,name=default_nested_enum,json=defaultNestedEnum,enum=goproto.proto.test.TestAllTypes_NestedEnum,def=1" json:"default_nested_enum,omitempty"`
DefaultForeignEnum *ForeignEnum `protobuf:"varint,97,opt,name=default_foreign_enum,json=defaultForeignEnum,enum=goproto.proto.test.ForeignEnum,def=5" json:"default_foreign_enum,omitempty"`
// Types that are assignable to OneofField:
- // *TestAllTypes_OneofUint32
- // *TestAllTypes_OneofNestedMessage
- // *TestAllTypes_OneofString
- // *TestAllTypes_OneofBytes
- // *TestAllTypes_OneofBool
- // *TestAllTypes_OneofUint64
- // *TestAllTypes_OneofFloat
- // *TestAllTypes_OneofDouble
- // *TestAllTypes_OneofEnum
- // *TestAllTypes_Oneofgroup
+ // - *TestAllTypes_OneofUint32
+ // - *TestAllTypes_OneofNestedMessage
+ // - *TestAllTypes_OneofString
+ // - *TestAllTypes_OneofBytes
+ // - *TestAllTypes_OneofBool
+ // - *TestAllTypes_OneofUint64
+ // - *TestAllTypes_OneofFloat
+ // - *TestAllTypes_OneofDouble
+ // - *TestAllTypes_OneofEnum
+ // - *TestAllTypes_Oneofgroup
OneofField isTestAllTypes_OneofField `protobuf_oneof:"oneof_field"`
// A oneof with exactly one field.
//
// Types that are assignable to OneofOptional:
- // *TestAllTypes_OneofOptionalUint32
+ // - *TestAllTypes_OneofOptionalUint32
OneofOptional isTestAllTypes_OneofOptional `protobuf_oneof:"oneof_optional"`
}
@@ -1125,7 +1125,7 @@
// Deprecated: Do not use.
DeprecatedInt32 *int32 `protobuf:"varint,1,opt,name=deprecated_int32,json=deprecatedInt32" json:"deprecated_int32,omitempty"`
// Types that are assignable to DeprecatedOneof:
- // *TestDeprecatedMessage_DeprecatedOneofField
+ // - *TestDeprecatedMessage_DeprecatedOneofField
DeprecatedOneof isTestDeprecatedMessage_DeprecatedOneof `protobuf_oneof:"deprecated_oneof"`
}
@@ -1539,7 +1539,7 @@
RepeatedMessage []*TestRequired `protobuf:"bytes,2,rep,name=repeated_message,json=repeatedMessage" json:"repeated_message,omitempty"`
MapMessage map[int32]*TestRequired `protobuf:"bytes,3,rep,name=map_message,json=mapMessage" json:"map_message,omitempty" protobuf_key:"varint,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// Types that are assignable to OneofField:
- // *TestRequiredForeign_OneofMessage
+ // - *TestRequiredForeign_OneofMessage
OneofField isTestRequiredForeign_OneofField `protobuf_oneof:"oneof_field"`
}
diff --git a/internal/testprotos/test3/test.pb.go b/internal/testprotos/test3/test.pb.go
index 6375d8f..6a0b4d2 100644
--- a/internal/testprotos/test3/test.pb.go
+++ b/internal/testprotos/test3/test.pb.go
@@ -204,15 +204,15 @@
MapStringNestedMessage map[string]*TestAllTypes_NestedMessage `protobuf:"bytes,71,rep,name=map_string_nested_message,json=mapStringNestedMessage,proto3" json:"map_string_nested_message,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
MapStringNestedEnum map[string]TestAllTypes_NestedEnum `protobuf:"bytes,73,rep,name=map_string_nested_enum,json=mapStringNestedEnum,proto3" json:"map_string_nested_enum,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=goproto.proto.test3.TestAllTypes_NestedEnum"`
// Types that are assignable to OneofField:
- // *TestAllTypes_OneofUint32
- // *TestAllTypes_OneofNestedMessage
- // *TestAllTypes_OneofString
- // *TestAllTypes_OneofBytes
- // *TestAllTypes_OneofBool
- // *TestAllTypes_OneofUint64
- // *TestAllTypes_OneofFloat
- // *TestAllTypes_OneofDouble
- // *TestAllTypes_OneofEnum
+ // - *TestAllTypes_OneofUint32
+ // - *TestAllTypes_OneofNestedMessage
+ // - *TestAllTypes_OneofString
+ // - *TestAllTypes_OneofBytes
+ // - *TestAllTypes_OneofBool
+ // - *TestAllTypes_OneofUint64
+ // - *TestAllTypes_OneofFloat
+ // - *TestAllTypes_OneofDouble
+ // - *TestAllTypes_OneofEnum
OneofField isTestAllTypes_OneofField `protobuf_oneof:"oneof_field"`
}
diff --git a/internal/testprotos/textpb2/test.pb.go b/internal/testprotos/textpb2/test.pb.go
index 4c0124a..c11c144 100644
--- a/internal/testprotos/textpb2/test.pb.go
+++ b/internal/testprotos/textpb2/test.pb.go
@@ -869,7 +869,7 @@
RptNested []*NestedWithRequired `protobuf:"bytes,2,rep,name=rpt_nested,json=rptNested" json:"rpt_nested,omitempty"`
StrToNested map[string]*NestedWithRequired `protobuf:"bytes,3,rep,name=str_to_nested,json=strToNested" json:"str_to_nested,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// Types that are assignable to Union:
- // *IndirectRequired_OneofNested
+ // - *IndirectRequired_OneofNested
Union isIndirectRequired_Union `protobuf_oneof:"union"`
}
diff --git a/internal/testprotos/textpb3/test.pb.go b/internal/testprotos/textpb3/test.pb.go
index 51e94c8..d035a7e 100644
--- a/internal/testprotos/textpb3/test.pb.go
+++ b/internal/testprotos/textpb3/test.pb.go
@@ -686,9 +686,9 @@
unknownFields protoimpl.UnknownFields
// Types that are assignable to Union:
- // *Oneofs_OneofEnum
- // *Oneofs_OneofString
- // *Oneofs_OneofNested
+ // - *Oneofs_OneofEnum
+ // - *Oneofs_OneofString
+ // - *Oneofs_OneofNested
Union isOneofs_Union `protobuf_oneof:"union"`
}
diff --git a/types/known/structpb/struct.pb.go b/types/known/structpb/struct.pb.go
index 5866905..b318d16 100644
--- a/types/known/structpb/struct.pb.go
+++ b/types/known/structpb/struct.pb.go
@@ -44,8 +44,7 @@
// "google.golang.org/protobuf/encoding/protojson" package
// ensures that they will be serialized as their JSON equivalent.
//
-//
-// Conversion to and from a Go interface
+// # Conversion to and from a Go interface
//
// The standard Go "encoding/json" package has functionality to serialize
// arbitrary types to a large degree. The Value.AsInterface, Struct.AsMap, and
@@ -58,8 +57,7 @@
// forms back as Value, Struct, and ListValue messages, use the NewStruct,
// NewList, and NewValue constructor functions.
//
-//
-// Example usage
+// # Example usage
//
// Consider the following example JSON object:
//
@@ -118,7 +116,6 @@
// ... // handle error
// }
// ... // make use of m as a *structpb.Value
-//
package structpb
import (
@@ -135,7 +132,7 @@
// `NullValue` is a singleton enumeration to represent the null value for the
// `Value` type union.
//
-// The JSON representation for `NullValue` is JSON `null`.
+// The JSON representation for `NullValue` is JSON `null`.
type NullValue int32
const (
@@ -286,12 +283,12 @@
// The kind of value.
//
// Types that are assignable to Kind:
- // *Value_NullValue
- // *Value_NumberValue
- // *Value_StringValue
- // *Value_BoolValue
- // *Value_StructValue
- // *Value_ListValue
+ // - *Value_NullValue
+ // - *Value_NumberValue
+ // - *Value_StringValue
+ // - *Value_BoolValue
+ // - *Value_StructValue
+ // - *Value_ListValue
Kind isValue_Kind `protobuf_oneof:"kind"`
}
To view, visit change 421154. To unsubscribe, or for help writing mail filters, visit settings.