diff --git a/test/asymetric-issue125/asym.pb.go b/test/asymetric-issue125/asym.pb.go index 22fef6aee1..815bc840c5 100644 --- a/test/asymetric-issue125/asym.pb.go +++ b/test/asymetric-issue125/asym.pb.go @@ -44,8 +44,7 @@ func (m *M) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_M.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/casttype/combos/both/casttype.pb.go b/test/casttype/combos/both/casttype.pb.go index a998e58240..83f3fe3ddf 100644 --- a/test/casttype/combos/both/casttype.pb.go +++ b/test/casttype/combos/both/casttype.pb.go @@ -67,8 +67,7 @@ func (m *Castaway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Castaway.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -106,8 +105,7 @@ func (m *Wilson) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Wilson.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/casttype/combos/marshaler/casttype.pb.go b/test/casttype/combos/marshaler/casttype.pb.go index 71c0990af9..e863febd04 100644 --- a/test/casttype/combos/marshaler/casttype.pb.go +++ b/test/casttype/combos/marshaler/casttype.pb.go @@ -66,8 +66,7 @@ func (m *Castaway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Castaway.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -105,8 +104,7 @@ func (m *Wilson) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Wilson.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/castvalue/combos/both/castvalue.pb.go b/test/castvalue/combos/both/castvalue.pb.go index e1761bc2fd..c9aae4fcf4 100644 --- a/test/castvalue/combos/both/castvalue.pb.go +++ b/test/castvalue/combos/both/castvalue.pb.go @@ -51,8 +51,7 @@ func (m *Castaway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Castaway.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -90,8 +89,7 @@ func (m *Wilson) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Wilson.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/castvalue/combos/marshaler/castvalue.pb.go b/test/castvalue/combos/marshaler/castvalue.pb.go index 65c2003fb9..982ad1551a 100644 --- a/test/castvalue/combos/marshaler/castvalue.pb.go +++ b/test/castvalue/combos/marshaler/castvalue.pb.go @@ -50,8 +50,7 @@ func (m *Castaway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Castaway.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -89,8 +88,7 @@ func (m *Wilson) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Wilson.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/combos/both/thetest.pb.go b/test/combos/both/thetest.pb.go index 08b25b5387..c0e01df51b 100644 --- a/test/combos/both/thetest.pb.go +++ b/test/combos/both/thetest.pb.go @@ -273,8 +273,7 @@ func (m *NidOptNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -326,8 +325,7 @@ func (m *NinOptNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -379,8 +377,7 @@ func (m *NidRepNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidRepNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -432,8 +429,7 @@ func (m *NinRepNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinRepNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -483,8 +479,7 @@ func (m *NidRepPackedNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NidRepPackedNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -534,8 +529,7 @@ func (m *NinRepPackedNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NinRepPackedNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -582,8 +576,7 @@ func (m *NidOptStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidOptStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -630,8 +623,7 @@ func (m *NinOptStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -678,8 +670,7 @@ func (m *NidRepStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidRepStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -726,8 +717,7 @@ func (m *NinRepStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinRepStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -767,8 +757,7 @@ func (m *NidEmbeddedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NidEmbeddedStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -808,8 +797,7 @@ func (m *NinEmbeddedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NinEmbeddedStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -848,8 +836,7 @@ func (m *NidNestedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_NidNestedStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -888,8 +875,7 @@ func (m *NinNestedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_NinNestedStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -928,8 +914,7 @@ func (m *NidOptCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidOptCustom.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -967,8 +952,7 @@ func (m *CustomDash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CustomDash.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1007,8 +991,7 @@ func (m *NinOptCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptCustom.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1047,8 +1030,7 @@ func (m *NidRepCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidRepCustom.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1087,8 +1069,7 @@ func (m *NinRepCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinRepCustom.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1134,8 +1115,7 @@ func (m *NinOptNativeUnion) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NinOptNativeUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1181,8 +1161,7 @@ func (m *NinOptStructUnion) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NinOptStructUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1222,8 +1201,7 @@ func (m *NinEmbeddedStructUnion) XXX_Marshal(b []byte, deterministic bool) ([]by if deterministic { return xxx_messageInfo_NinEmbeddedStructUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1263,8 +1241,7 @@ func (m *NinNestedStructUnion) XXX_Marshal(b []byte, deterministic bool) ([]byte if deterministic { return xxx_messageInfo_NinNestedStructUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1304,8 +1281,7 @@ func (m *Tree) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Tree.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1344,8 +1320,7 @@ func (m *OrBranch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OrBranch.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1384,8 +1359,7 @@ func (m *AndBranch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AndBranch.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1424,8 +1398,7 @@ func (m *Leaf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Leaf.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1465,8 +1438,7 @@ func (m *DeepTree) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DeepTree.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1504,8 +1476,7 @@ func (m *ADeepBranch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_ADeepBranch.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1544,8 +1515,7 @@ func (m *AndDeepBranch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_AndDeepBranch.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1583,8 +1553,7 @@ func (m *DeepLeaf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DeepLeaf.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1621,8 +1590,7 @@ func (m *Nil) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Nil.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1660,8 +1628,7 @@ func (m *NidOptEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NidOptEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1701,8 +1668,7 @@ func (m *NinOptEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NinOptEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1742,8 +1708,7 @@ func (m *NidRepEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NidRepEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1783,8 +1748,7 @@ func (m *NinRepEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NinRepEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1824,8 +1788,7 @@ func (m *NinOptEnumDefault) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NinOptEnumDefault.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1890,8 +1853,7 @@ func (m *AnotherNinOptEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_AnotherNinOptEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1931,8 +1893,7 @@ func (m *AnotherNinOptEnumDefault) XXX_Marshal(b []byte, deterministic bool) ([] if deterministic { return xxx_messageInfo_AnotherNinOptEnumDefault.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1997,8 +1958,7 @@ func (m *Timer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Timer.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2046,8 +2006,7 @@ func (m *MyExtendable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_MyExtendable.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2098,8 +2057,7 @@ func (m *OtherExtenable) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro if deterministic { return xxx_messageInfo_OtherExtenable.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2140,8 +2098,7 @@ func (m *NestedDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, er if deterministic { return xxx_messageInfo_NestedDefinition.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2180,8 +2137,7 @@ func (m *NestedDefinition_NestedMessage) XXX_Marshal(b []byte, deterministic boo if deterministic { return xxx_messageInfo_NestedDefinition_NestedMessage.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2221,8 +2177,7 @@ func (m *NestedDefinition_NestedMessage_NestedNestedMsg) XXX_Marshal(b []byte, d if deterministic { return xxx_messageInfo_NestedDefinition_NestedMessage_NestedNestedMsg.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2262,8 +2217,7 @@ func (m *NestedScope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NestedScope.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2315,8 +2269,7 @@ func (m *NinOptNativeDefault) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NinOptNativeDefault.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2474,8 +2427,7 @@ func (m *CustomContainer) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_CustomContainer.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2527,8 +2479,7 @@ func (m *CustomNameNidOptNative) XXX_Marshal(b []byte, deterministic bool) ([]by if deterministic { return xxx_messageInfo_CustomNameNidOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2580,8 +2531,7 @@ func (m *CustomNameNinOptNative) XXX_Marshal(b []byte, deterministic bool) ([]by if deterministic { return xxx_messageInfo_CustomNameNinOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2633,8 +2583,7 @@ func (m *CustomNameNinRepNative) XXX_Marshal(b []byte, deterministic bool) ([]by if deterministic { return xxx_messageInfo_CustomNameNinRepNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2681,8 +2630,7 @@ func (m *CustomNameNinStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_CustomNameNinStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2723,8 +2671,7 @@ func (m *CustomNameCustomType) XXX_Marshal(b []byte, deterministic bool) ([]byte if deterministic { return xxx_messageInfo_CustomNameCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2764,8 +2711,7 @@ func (m *CustomNameNinEmbeddedStructUnion) XXX_Marshal(b []byte, deterministic b if deterministic { return xxx_messageInfo_CustomNameNinEmbeddedStructUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2804,8 +2750,7 @@ func (m *CustomNameEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro if deterministic { return xxx_messageInfo_CustomNameEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2859,8 +2804,7 @@ func (m *NoExtensionsMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_NoExtensionsMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2897,8 +2841,7 @@ func (m *Unrecognized) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_Unrecognized.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2937,8 +2880,7 @@ func (m *UnrecognizedWithInner) XXX_Marshal(b []byte, deterministic bool) ([]byt if deterministic { return xxx_messageInfo_UnrecognizedWithInner.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2975,8 +2917,7 @@ func (m *UnrecognizedWithInner_Inner) XXX_Marshal(b []byte, deterministic bool) if deterministic { return xxx_messageInfo_UnrecognizedWithInner_Inner.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3015,8 +2956,7 @@ func (m *UnrecognizedWithEmbed) XXX_Marshal(b []byte, deterministic bool) ([]byt if deterministic { return xxx_messageInfo_UnrecognizedWithEmbed.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3053,8 +2993,7 @@ func (m *UnrecognizedWithEmbed_Embedded) XXX_Marshal(b []byte, deterministic boo if deterministic { return xxx_messageInfo_UnrecognizedWithEmbed_Embedded.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3093,8 +3032,7 @@ func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Node.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3132,8 +3070,7 @@ func (m *NonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3171,8 +3108,7 @@ func (m *NidOptNonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]b if deterministic { return xxx_messageInfo_NidOptNonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3210,8 +3146,7 @@ func (m *NinOptNonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]b if deterministic { return xxx_messageInfo_NinOptNonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3249,8 +3184,7 @@ func (m *NidRepNonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]b if deterministic { return xxx_messageInfo_NidRepNonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3288,8 +3222,7 @@ func (m *NinRepNonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]b if deterministic { return xxx_messageInfo_NinRepNonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3327,8 +3260,7 @@ func (m *ProtoType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ProtoType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/combos/marshaler/thetest.pb.go b/test/combos/marshaler/thetest.pb.go index ee2a83afa5..93adba2751 100644 --- a/test/combos/marshaler/thetest.pb.go +++ b/test/combos/marshaler/thetest.pb.go @@ -272,8 +272,7 @@ func (m *NidOptNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -325,8 +324,7 @@ func (m *NinOptNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -378,8 +376,7 @@ func (m *NidRepNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidRepNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -431,8 +428,7 @@ func (m *NinRepNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinRepNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -482,8 +478,7 @@ func (m *NidRepPackedNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NidRepPackedNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -533,8 +528,7 @@ func (m *NinRepPackedNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NinRepPackedNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -581,8 +575,7 @@ func (m *NidOptStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidOptStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -629,8 +622,7 @@ func (m *NinOptStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -677,8 +669,7 @@ func (m *NidRepStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidRepStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -725,8 +716,7 @@ func (m *NinRepStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinRepStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -766,8 +756,7 @@ func (m *NidEmbeddedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NidEmbeddedStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -807,8 +796,7 @@ func (m *NinEmbeddedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NinEmbeddedStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -847,8 +835,7 @@ func (m *NidNestedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_NidNestedStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -887,8 +874,7 @@ func (m *NinNestedStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_NinNestedStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -927,8 +913,7 @@ func (m *NidOptCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidOptCustom.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -966,8 +951,7 @@ func (m *CustomDash) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CustomDash.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1006,8 +990,7 @@ func (m *NinOptCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptCustom.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1046,8 +1029,7 @@ func (m *NidRepCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidRepCustom.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1086,8 +1068,7 @@ func (m *NinRepCustom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinRepCustom.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1133,8 +1114,7 @@ func (m *NinOptNativeUnion) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NinOptNativeUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1180,8 +1160,7 @@ func (m *NinOptStructUnion) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NinOptStructUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1221,8 +1200,7 @@ func (m *NinEmbeddedStructUnion) XXX_Marshal(b []byte, deterministic bool) ([]by if deterministic { return xxx_messageInfo_NinEmbeddedStructUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1262,8 +1240,7 @@ func (m *NinNestedStructUnion) XXX_Marshal(b []byte, deterministic bool) ([]byte if deterministic { return xxx_messageInfo_NinNestedStructUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1303,8 +1280,7 @@ func (m *Tree) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Tree.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1343,8 +1319,7 @@ func (m *OrBranch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OrBranch.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1383,8 +1358,7 @@ func (m *AndBranch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AndBranch.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1423,8 +1397,7 @@ func (m *Leaf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Leaf.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1464,8 +1437,7 @@ func (m *DeepTree) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DeepTree.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1503,8 +1475,7 @@ func (m *ADeepBranch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_ADeepBranch.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1543,8 +1514,7 @@ func (m *AndDeepBranch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_AndDeepBranch.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1582,8 +1552,7 @@ func (m *DeepLeaf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_DeepLeaf.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1620,8 +1589,7 @@ func (m *Nil) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Nil.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1659,8 +1627,7 @@ func (m *NidOptEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NidOptEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1700,8 +1667,7 @@ func (m *NinOptEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NinOptEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1741,8 +1707,7 @@ func (m *NidRepEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NidRepEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1782,8 +1747,7 @@ func (m *NinRepEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NinRepEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1823,8 +1787,7 @@ func (m *NinOptEnumDefault) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NinOptEnumDefault.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1889,8 +1852,7 @@ func (m *AnotherNinOptEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_AnotherNinOptEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1930,8 +1892,7 @@ func (m *AnotherNinOptEnumDefault) XXX_Marshal(b []byte, deterministic bool) ([] if deterministic { return xxx_messageInfo_AnotherNinOptEnumDefault.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1996,8 +1957,7 @@ func (m *Timer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Timer.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2045,8 +2005,7 @@ func (m *MyExtendable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_MyExtendable.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2097,8 +2056,7 @@ func (m *OtherExtenable) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro if deterministic { return xxx_messageInfo_OtherExtenable.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2139,8 +2097,7 @@ func (m *NestedDefinition) XXX_Marshal(b []byte, deterministic bool) ([]byte, er if deterministic { return xxx_messageInfo_NestedDefinition.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2179,8 +2136,7 @@ func (m *NestedDefinition_NestedMessage) XXX_Marshal(b []byte, deterministic boo if deterministic { return xxx_messageInfo_NestedDefinition_NestedMessage.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2220,8 +2176,7 @@ func (m *NestedDefinition_NestedMessage_NestedNestedMsg) XXX_Marshal(b []byte, d if deterministic { return xxx_messageInfo_NestedDefinition_NestedMessage_NestedNestedMsg.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2261,8 +2216,7 @@ func (m *NestedScope) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NestedScope.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2314,8 +2268,7 @@ func (m *NinOptNativeDefault) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NinOptNativeDefault.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2473,8 +2426,7 @@ func (m *CustomContainer) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_CustomContainer.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2526,8 +2478,7 @@ func (m *CustomNameNidOptNative) XXX_Marshal(b []byte, deterministic bool) ([]by if deterministic { return xxx_messageInfo_CustomNameNidOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2579,8 +2530,7 @@ func (m *CustomNameNinOptNative) XXX_Marshal(b []byte, deterministic bool) ([]by if deterministic { return xxx_messageInfo_CustomNameNinOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2632,8 +2582,7 @@ func (m *CustomNameNinRepNative) XXX_Marshal(b []byte, deterministic bool) ([]by if deterministic { return xxx_messageInfo_CustomNameNinRepNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2680,8 +2629,7 @@ func (m *CustomNameNinStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_CustomNameNinStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2722,8 +2670,7 @@ func (m *CustomNameCustomType) XXX_Marshal(b []byte, deterministic bool) ([]byte if deterministic { return xxx_messageInfo_CustomNameCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2763,8 +2710,7 @@ func (m *CustomNameNinEmbeddedStructUnion) XXX_Marshal(b []byte, deterministic b if deterministic { return xxx_messageInfo_CustomNameNinEmbeddedStructUnion.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2803,8 +2749,7 @@ func (m *CustomNameEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro if deterministic { return xxx_messageInfo_CustomNameEnum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2858,8 +2803,7 @@ func (m *NoExtensionsMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_NoExtensionsMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2896,8 +2840,7 @@ func (m *Unrecognized) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_Unrecognized.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2936,8 +2879,7 @@ func (m *UnrecognizedWithInner) XXX_Marshal(b []byte, deterministic bool) ([]byt if deterministic { return xxx_messageInfo_UnrecognizedWithInner.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -2974,8 +2916,7 @@ func (m *UnrecognizedWithInner_Inner) XXX_Marshal(b []byte, deterministic bool) if deterministic { return xxx_messageInfo_UnrecognizedWithInner_Inner.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3014,8 +2955,7 @@ func (m *UnrecognizedWithEmbed) XXX_Marshal(b []byte, deterministic bool) ([]byt if deterministic { return xxx_messageInfo_UnrecognizedWithEmbed.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3052,8 +2992,7 @@ func (m *UnrecognizedWithEmbed_Embedded) XXX_Marshal(b []byte, deterministic boo if deterministic { return xxx_messageInfo_UnrecognizedWithEmbed_Embedded.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3092,8 +3031,7 @@ func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Node.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3131,8 +3069,7 @@ func (m *NonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_NonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3170,8 +3107,7 @@ func (m *NidOptNonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]b if deterministic { return xxx_messageInfo_NidOptNonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3209,8 +3145,7 @@ func (m *NinOptNonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]b if deterministic { return xxx_messageInfo_NinOptNonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3248,8 +3183,7 @@ func (m *NidRepNonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]b if deterministic { return xxx_messageInfo_NidRepNonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3287,8 +3221,7 @@ func (m *NinRepNonByteCustomType) XXX_Marshal(b []byte, deterministic bool) ([]b if deterministic { return xxx_messageInfo_NinRepNonByteCustomType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -3326,8 +3259,7 @@ func (m *ProtoType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ProtoType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/data/data.pb.go b/test/data/data.pb.go index 8935639179..38654d0448 100644 --- a/test/data/data.pb.go +++ b/test/data/data.pb.go @@ -45,8 +45,7 @@ func (m *MyMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MyMessage.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/deterministic/deterministic.pb.go b/test/deterministic/deterministic.pb.go index 8416bf534e..b52c3236f5 100644 --- a/test/deterministic/deterministic.pb.go +++ b/test/deterministic/deterministic.pb.go @@ -41,8 +41,7 @@ func (m *OrderedMap) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_OrderedMap.Unmarshal(m, b) } func (m *OrderedMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -87,8 +86,7 @@ func (m *UnorderedMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_UnorderedMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -170,8 +168,7 @@ func (m *NestedOrderedMap) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NestedOrderedMap.Unmarshal(m, b) } func (m *NestedOrderedMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -220,8 +217,7 @@ func (m *NestedMap1) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_NestedMap1.Unmarshal(m, b) } func (m *NestedMap1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -267,8 +263,7 @@ func (m *NestedUnorderedMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NestedUnorderedMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -321,8 +316,7 @@ func (m *NestedMap2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NestedMap2.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/enumdecl/enumdecl.pb.go b/test/enumdecl/enumdecl.pb.go index f762751eb2..2baef6fed4 100644 --- a/test/enumdecl/enumdecl.pb.go +++ b/test/enumdecl/enumdecl.pb.go @@ -62,8 +62,7 @@ func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Message.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/enumdecl_all/enumdeclall.pb.go b/test/enumdecl_all/enumdeclall.pb.go index 2f0979a6a0..cccd1aa009 100644 --- a/test/enumdecl_all/enumdeclall.pb.go +++ b/test/enumdecl_all/enumdeclall.pb.go @@ -88,8 +88,7 @@ func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Message.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/example/example.pb.go b/test/example/example.pb.go index e23f67a638..b483b2e560 100644 --- a/test/example/example.pb.go +++ b/test/example/example.pb.go @@ -53,8 +53,7 @@ func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_A.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -93,8 +92,7 @@ func (m *B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_B.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -132,8 +130,7 @@ func (m *C) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_C.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -179,8 +176,7 @@ func (m *U) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_U.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -247,8 +243,7 @@ func (m *E) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_E.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -285,8 +280,7 @@ func (m *R) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_R.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -331,8 +325,7 @@ func (m *CastType) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CastType.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/fuzztests/fuzz.pb.go b/test/fuzztests/fuzz.pb.go index d9f66affc6..4252e2f7a9 100644 --- a/test/fuzztests/fuzz.pb.go +++ b/test/fuzztests/fuzz.pb.go @@ -45,8 +45,7 @@ func (m *Nil) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Nil.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -97,8 +96,7 @@ func (m *NinRepPackedNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NinRepPackedNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -242,8 +240,7 @@ func (m *NinOptNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -396,8 +393,7 @@ func (m *NinOptStruct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptStruct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/importcustom-issue389/imported/a.pb.go b/test/importcustom-issue389/imported/a.pb.go index f8bfb01a6e..f48f239eaf 100644 --- a/test/importcustom-issue389/imported/a.pb.go +++ b/test/importcustom-issue389/imported/a.pb.go @@ -44,8 +44,7 @@ func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_A.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/importcustom-issue389/importing/c.pb.go b/test/importcustom-issue389/importing/c.pb.go index fe6b0d29d6..ddb5712694 100644 --- a/test/importcustom-issue389/importing/c.pb.go +++ b/test/importcustom-issue389/importing/c.pb.go @@ -46,8 +46,7 @@ func (m *C) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_C.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/indeximport-issue72/index/index.pb.go b/test/indeximport-issue72/index/index.pb.go index e3d3f01ca9..13f53c7715 100644 --- a/test/indeximport-issue72/index/index.pb.go +++ b/test/indeximport-issue72/index/index.pb.go @@ -45,8 +45,7 @@ func (m *IndexQuery) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_IndexQuery.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/indeximport-issue72/indeximport.pb.go b/test/indeximport-issue72/indeximport.pb.go index 9083cb8976..092f6b5394 100644 --- a/test/indeximport-issue72/indeximport.pb.go +++ b/test/indeximport-issue72/indeximport.pb.go @@ -45,8 +45,7 @@ func (m *IndexQueries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_IndexQueries.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/int64support/object.pb.go b/test/int64support/object.pb.go index 9c80f6f139..64baa8413b 100644 --- a/test/int64support/object.pb.go +++ b/test/int64support/object.pb.go @@ -43,8 +43,7 @@ func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Object.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue260/issue260.pb.go b/test/issue260/issue260.pb.go index 891dadf753..f416f5c288 100644 --- a/test/issue260/issue260.pb.go +++ b/test/issue260/issue260.pb.go @@ -40,8 +40,7 @@ func (m *Dropped) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Dropped.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -87,8 +86,7 @@ func (m *DroppedWithoutGetters) XXX_Marshal(b []byte, deterministic bool) ([]byt if deterministic { return xxx_messageInfo_DroppedWithoutGetters.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -127,8 +125,7 @@ func (m *Kept) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Kept.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue261/issue261.pb.go b/test/issue261/issue261.pb.go index 38becbc0d8..a3357f9816 100644 --- a/test/issue261/issue261.pb.go +++ b/test/issue261/issue261.pb.go @@ -46,8 +46,7 @@ func (m *MapStdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_MapStdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue262/timefail.pb.go b/test/issue262/timefail.pb.go index 4abf3ff160..0f7b5f6a83 100644 --- a/test/issue262/timefail.pb.go +++ b/test/issue262/timefail.pb.go @@ -45,8 +45,7 @@ func (m *TimeFail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TimeFail.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue322/issue322.pb.go b/test/issue322/issue322.pb.go index 1bd153fd9f..6c4e8e598b 100644 --- a/test/issue322/issue322.pb.go +++ b/test/issue322/issue322.pb.go @@ -48,8 +48,7 @@ func (m *OneofTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OneofTest.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue330/issue330.pb.go b/test/issue330/issue330.pb.go index 9114fafc3a..4e9d2d5b86 100644 --- a/test/issue330/issue330.pb.go +++ b/test/issue330/issue330.pb.go @@ -44,8 +44,7 @@ func (m *Object) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Object.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue42order/issue42.pb.go b/test/issue42order/issue42.pb.go index eef6d5384b..83a1221177 100644 --- a/test/issue42order/issue42.pb.go +++ b/test/issue42order/issue42.pb.go @@ -45,8 +45,7 @@ func (m *UnorderedFields) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_UnorderedFields.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -100,8 +99,7 @@ func (m *OrderedFields) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_OrderedFields.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue449/issue449.pb.go b/test/issue449/issue449.pb.go index 60b8cd3bd0..ec2f398683 100644 --- a/test/issue449/issue449.pb.go +++ b/test/issue449/issue449.pb.go @@ -48,8 +48,7 @@ func (m *CodeGenMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CodeGenMsg.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue498/issue498.pb.go b/test/issue498/issue498.pb.go index 2a1d170b84..f2813a694b 100644 --- a/test/issue498/issue498.pb.go +++ b/test/issue498/issue498.pb.go @@ -48,8 +48,7 @@ func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Message.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue503/issue503.pb.go b/test/issue503/issue503.pb.go index c7cdc8ccf9..62d74280f5 100644 --- a/test/issue503/issue503.pb.go +++ b/test/issue503/issue503.pb.go @@ -47,8 +47,7 @@ func (m *Foo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Foo.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue530/issue530.pb.go b/test/issue530/issue530.pb.go index ba07be2eed..9c6adaf247 100644 --- a/test/issue530/issue530.pb.go +++ b/test/issue530/issue530.pb.go @@ -53,8 +53,7 @@ func (m *Foo5) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Foo5.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -173,8 +172,7 @@ func (m *Bar1) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bar1.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -216,8 +214,7 @@ func (m *Bar2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bar2.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -260,8 +257,7 @@ func (m *Bar3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bar3.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -310,8 +306,7 @@ func (m *Bar4) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bar4.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -354,8 +349,7 @@ func (m *Bar5) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bar5.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -407,8 +401,7 @@ func (m *Bar7) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bar7.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -471,8 +464,7 @@ func (m *Bar8) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bar8.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -515,8 +507,7 @@ func (m *Bar9) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Bar9.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/issue617/issue617.pb.go b/test/issue617/issue617.pb.go index b3a7744066..87f2224df7 100644 --- a/test/issue617/issue617.pb.go +++ b/test/issue617/issue617.pb.go @@ -45,8 +45,7 @@ func (m *Foo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Foo.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -117,8 +116,7 @@ func (m *Foo_Bar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Foo_Bar.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/mapdefaults/combos/both/map.pb.go b/test/mapdefaults/combos/both/map.pb.go index 713e34af36..4702207576 100644 --- a/test/mapdefaults/combos/both/map.pb.go +++ b/test/mapdefaults/combos/both/map.pb.go @@ -50,8 +50,7 @@ func (m *MapTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MapTest.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -89,8 +88,7 @@ func (m *FakeMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_FakeMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -130,8 +128,7 @@ func (m *FakeMapEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_FakeMapEntry.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/mapdefaults/combos/marshaler/map.pb.go b/test/mapdefaults/combos/marshaler/map.pb.go index 0f2329b5d8..6525809656 100644 --- a/test/mapdefaults/combos/marshaler/map.pb.go +++ b/test/mapdefaults/combos/marshaler/map.pb.go @@ -49,8 +49,7 @@ func (m *MapTest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_MapTest.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -88,8 +87,7 @@ func (m *FakeMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_FakeMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -129,8 +127,7 @@ func (m *FakeMapEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_FakeMapEntry.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/mapsproto2/combos/both/mapsproto2.pb.go b/test/mapsproto2/combos/both/mapsproto2.pb.go index c8429dfcad..20183d944c 100644 --- a/test/mapsproto2/combos/both/mapsproto2.pb.go +++ b/test/mapsproto2/combos/both/mapsproto2.pb.go @@ -97,8 +97,7 @@ func (m *FloatingPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_FloatingPoint.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -139,8 +138,7 @@ func (m *CustomMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CustomMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -194,8 +192,7 @@ func (m *AllMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllMaps.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -246,8 +243,7 @@ func (m *AllMapsOrdered) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AllMapsOrdered) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/mapsproto2/combos/marshaler/mapsproto2.pb.go b/test/mapsproto2/combos/marshaler/mapsproto2.pb.go index 385035b470..da0a829528 100644 --- a/test/mapsproto2/combos/marshaler/mapsproto2.pb.go +++ b/test/mapsproto2/combos/marshaler/mapsproto2.pb.go @@ -96,8 +96,7 @@ func (m *FloatingPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_FloatingPoint.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -138,8 +137,7 @@ func (m *CustomMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_CustomMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -193,8 +191,7 @@ func (m *AllMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllMaps.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -245,8 +242,7 @@ func (m *AllMapsOrdered) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AllMapsOrdered.Unmarshal(m, b) } func (m *AllMapsOrdered) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/nopackage/nopackage.pb.go b/test/nopackage/nopackage.pb.go index 769fb0a81e..f78048cd88 100644 --- a/test/nopackage/nopackage.pb.go +++ b/test/nopackage/nopackage.pb.go @@ -43,8 +43,7 @@ func (m *M) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_M.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/oneof/combos/both/one.pb.go b/test/oneof/combos/both/one.pb.go index ef827249d2..cfab77f64d 100644 --- a/test/oneof/combos/both/one.pb.go +++ b/test/oneof/combos/both/one.pb.go @@ -52,8 +52,7 @@ func (m *Subby) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Subby.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -108,8 +107,7 @@ func (m *AllTypesOneOf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_AllTypesOneOf.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -372,8 +370,7 @@ func (m *TwoOneofs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TwoOneofs.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -526,8 +523,7 @@ func (m *CustomOneof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_CustomOneof.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/oneof/combos/marshaler/one.pb.go b/test/oneof/combos/marshaler/one.pb.go index 67848eaa3b..3cb484150f 100644 --- a/test/oneof/combos/marshaler/one.pb.go +++ b/test/oneof/combos/marshaler/one.pb.go @@ -51,8 +51,7 @@ func (m *Subby) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Subby.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -107,8 +106,7 @@ func (m *AllTypesOneOf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_AllTypesOneOf.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -371,8 +369,7 @@ func (m *TwoOneofs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_TwoOneofs.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -525,8 +522,7 @@ func (m *CustomOneof) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_CustomOneof.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/oneof3/combos/both/one.pb.go b/test/oneof3/combos/both/one.pb.go index 4f526a5507..3628b66e00 100644 --- a/test/oneof3/combos/both/one.pb.go +++ b/test/oneof3/combos/both/one.pb.go @@ -50,8 +50,7 @@ func (m *Subby) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Subby.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -106,8 +105,7 @@ func (m *SampleOneOf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_SampleOneOf.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/oneof3/combos/marshaler/one.pb.go b/test/oneof3/combos/marshaler/one.pb.go index e4947416d3..7aa9c45267 100644 --- a/test/oneof3/combos/marshaler/one.pb.go +++ b/test/oneof3/combos/marshaler/one.pb.go @@ -49,8 +49,7 @@ func (m *Subby) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Subby.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -105,8 +104,7 @@ func (m *SampleOneOf) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_SampleOneOf.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/protobuffer/protobuffer.pb.go b/test/protobuffer/protobuffer.pb.go index ae8df3a673..a525ed35ab 100644 --- a/test/protobuffer/protobuffer.pb.go +++ b/test/protobuffer/protobuffer.pb.go @@ -89,8 +89,7 @@ func (m *PBuffMarshaler) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro if deterministic { return xxx_messageInfo_PBuffMarshaler.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/protosize/protosize.pb.go b/test/protosize/protosize.pb.go index fce29a490a..afe348b776 100644 --- a/test/protosize/protosize.pb.go +++ b/test/protosize/protosize.pb.go @@ -47,8 +47,7 @@ func (m *SizeMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_SizeMessage.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/required/requiredexample.pb.go b/test/required/requiredexample.pb.go index 280fb4a988..63e78aa2fa 100644 --- a/test/required/requiredexample.pb.go +++ b/test/required/requiredexample.pb.go @@ -47,8 +47,7 @@ func (m *RequiredExample) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_RequiredExample.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -122,8 +121,7 @@ func (m *NidOptNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NidOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -281,8 +279,7 @@ func (m *NinOptNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_NinOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -426,8 +423,7 @@ func (m *NestedNinOptNative) XXX_Marshal(b []byte, deterministic bool) ([]byte, if deterministic { return xxx_messageInfo_NestedNinOptNative.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/sizeunderscore/sizeunderscore.pb.go b/test/sizeunderscore/sizeunderscore.pb.go index f52b349cc1..2ff78eb691 100644 --- a/test/sizeunderscore/sizeunderscore.pb.go +++ b/test/sizeunderscore/sizeunderscore.pb.go @@ -46,8 +46,7 @@ func (m *SizeMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_SizeMessage.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/theproto3/combos/both/theproto3.pb.go b/test/theproto3/combos/both/theproto3.pb.go index e044a6278a..6c604f7ec0 100644 --- a/test/theproto3/combos/both/theproto3.pb.go +++ b/test/theproto3/combos/both/theproto3.pb.go @@ -116,8 +116,7 @@ func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Message.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -155,8 +154,7 @@ func (m *Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Nested.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -210,8 +208,7 @@ func (m *AllMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllMaps.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -262,8 +259,7 @@ func (m *AllMapsOrdered) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } func (m *AllMapsOrdered) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -302,8 +298,7 @@ func (m *MessageWithMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro if deterministic { return xxx_messageInfo_MessageWithMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -341,8 +336,7 @@ func (m *FloatingPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_FloatingPoint.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -381,8 +375,7 @@ func (m *Uint128Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_Uint128Pair.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -419,8 +412,7 @@ func (m *ContainsNestedMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_ContainsNestedMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -458,8 +450,7 @@ func (m *ContainsNestedMap_NestedMap) XXX_Marshal(b []byte, deterministic bool) if deterministic { return xxx_messageInfo_ContainsNestedMap_NestedMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -497,8 +488,7 @@ func (m *NotPacked) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NotPacked.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/theproto3/combos/marshaler/theproto3.pb.go b/test/theproto3/combos/marshaler/theproto3.pb.go index 4feef58779..140348eaec 100644 --- a/test/theproto3/combos/marshaler/theproto3.pb.go +++ b/test/theproto3/combos/marshaler/theproto3.pb.go @@ -115,8 +115,7 @@ func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Message.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -154,8 +153,7 @@ func (m *Nested) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Nested.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -209,8 +207,7 @@ func (m *AllMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_AllMaps.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -261,8 +258,7 @@ func (m *AllMapsOrdered) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_AllMapsOrdered.Unmarshal(m, b) } func (m *AllMapsOrdered) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -301,8 +297,7 @@ func (m *MessageWithMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro if deterministic { return xxx_messageInfo_MessageWithMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -340,8 +335,7 @@ func (m *FloatingPoint) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_FloatingPoint.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -380,8 +374,7 @@ func (m *Uint128Pair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_Uint128Pair.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -418,8 +411,7 @@ func (m *ContainsNestedMap) XXX_Marshal(b []byte, deterministic bool) ([]byte, e if deterministic { return xxx_messageInfo_ContainsNestedMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -457,8 +449,7 @@ func (m *ContainsNestedMap_NestedMap) XXX_Marshal(b []byte, deterministic bool) if deterministic { return xxx_messageInfo_ContainsNestedMap_NestedMap.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -496,8 +487,7 @@ func (m *NotPacked) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NotPacked.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/typedecl/typedecl.pb.go b/test/typedecl/typedecl.pb.go index 568661eeda..9c7abc3278 100644 --- a/test/typedecl/typedecl.pb.go +++ b/test/typedecl/typedecl.pb.go @@ -36,8 +36,7 @@ func (m *Dropped) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Dropped.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -83,8 +82,7 @@ func (m *DroppedWithoutGetters) XXX_Marshal(b []byte, deterministic bool) ([]byt if deterministic { return xxx_messageInfo_DroppedWithoutGetters.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -123,8 +121,7 @@ func (m *Kept) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Kept.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/typedecl_all/typedeclall.pb.go b/test/typedecl_all/typedeclall.pb.go index b140fb9649..9df55c7080 100644 --- a/test/typedecl_all/typedeclall.pb.go +++ b/test/typedecl_all/typedeclall.pb.go @@ -36,8 +36,7 @@ func (m *Dropped) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Dropped.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -83,8 +82,7 @@ func (m *DroppedWithoutGetters) XXX_Marshal(b []byte, deterministic bool) ([]byt if deterministic { return xxx_messageInfo_DroppedWithoutGetters.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -123,8 +121,7 @@ func (m *Kept) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Kept.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/types/combos/both/types.pb.go b/test/types/combos/both/types.pb.go index 1aa5d651eb..41001aba69 100644 --- a/test/types/combos/both/types.pb.go +++ b/test/types/combos/both/types.pb.go @@ -60,8 +60,7 @@ func (m *KnownTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_KnownTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -205,8 +204,7 @@ func (m *ProtoTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ProtoTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -420,8 +418,7 @@ func (m *StdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -635,8 +632,7 @@ func (m *RepProtoTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_RepProtoTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -850,8 +846,7 @@ func (m *RepStdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_RepStdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1065,8 +1060,7 @@ func (m *MapProtoTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_MapProtoTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1280,8 +1274,7 @@ func (m *MapStdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_MapStdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1486,8 +1479,7 @@ func (m *OneofProtoTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_OneofProtoTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1693,8 +1685,7 @@ func (m *OneofStdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_OneofStdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/types/combos/marshaler/types.pb.go b/test/types/combos/marshaler/types.pb.go index 7bf1f5a66a..c8c04ef301 100644 --- a/test/types/combos/marshaler/types.pb.go +++ b/test/types/combos/marshaler/types.pb.go @@ -59,8 +59,7 @@ func (m *KnownTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_KnownTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -204,8 +203,7 @@ func (m *ProtoTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ProtoTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -419,8 +417,7 @@ func (m *StdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_StdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -634,8 +631,7 @@ func (m *RepProtoTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_RepProtoTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -849,8 +845,7 @@ func (m *RepStdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_RepStdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1064,8 +1059,7 @@ func (m *MapProtoTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_MapProtoTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1279,8 +1273,7 @@ func (m *MapStdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_MapStdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1485,8 +1478,7 @@ func (m *OneofProtoTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, err if deterministic { return xxx_messageInfo_OneofProtoTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -1692,8 +1684,7 @@ func (m *OneofStdTypes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_OneofStdTypes.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/unrecognized/unrecognized.pb.go b/test/unrecognized/unrecognized.pb.go index 4522459c70..2c5e278c70 100644 --- a/test/unrecognized/unrecognized.pb.go +++ b/test/unrecognized/unrecognized.pb.go @@ -50,8 +50,7 @@ func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_A.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -91,8 +90,7 @@ func (m *B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_B.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -130,8 +128,7 @@ func (m *D) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_D.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -174,8 +171,7 @@ func (m *C) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_C.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -213,8 +209,7 @@ func (m *U) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_U.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -282,8 +277,7 @@ func (m *OldA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OldA.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -322,8 +316,7 @@ func (m *OldB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OldB.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -365,8 +358,7 @@ func (m *OldC) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OldC.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -405,8 +397,7 @@ func (m *OldU) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_OldU.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/test/unrecognizedgroup/unrecognizedgroup.pb.go b/test/unrecognizedgroup/unrecognizedgroup.pb.go index 9bb6f20c9b..14b272b2f1 100644 --- a/test/unrecognizedgroup/unrecognizedgroup.pb.go +++ b/test/unrecognizedgroup/unrecognizedgroup.pb.go @@ -52,8 +52,7 @@ func (m *NewNoGroup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_NewNoGroup.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -91,8 +90,7 @@ func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_A.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/any.pb.go b/types/any.pb.go index 3074a3d8a0..e6c4f69dad 100644 --- a/types/any.pb.go +++ b/types/any.pb.go @@ -155,8 +155,7 @@ func (m *Any) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Any.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/api.pb.go b/types/api.pb.go index 61612e21a8..61866a8b2f 100644 --- a/types/api.pb.go +++ b/types/api.pb.go @@ -88,8 +88,7 @@ func (m *Api) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Api.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -194,8 +193,7 @@ func (m *Method) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Method.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -368,8 +366,7 @@ func (m *Mixin) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Mixin.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/duration.pb.go b/types/duration.pb.go index 32b957c2bd..7a624bf93f 100644 --- a/types/duration.pb.go +++ b/types/duration.pb.go @@ -115,8 +115,7 @@ func (m *Duration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Duration.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/empty.pb.go b/types/empty.pb.go index b061be5e4b..f5e66aae10 100644 --- a/types/empty.pb.go +++ b/types/empty.pb.go @@ -53,8 +53,7 @@ func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Empty.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/field_mask.pb.go b/types/field_mask.pb.go index 61ef57e2ca..8061fa14ab 100644 --- a/types/field_mask.pb.go +++ b/types/field_mask.pb.go @@ -244,8 +244,7 @@ func (m *FieldMask) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_FieldMask.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/source_context.pb.go b/types/source_context.pb.go index 9b0752ed50..b90f49788d 100644 --- a/types/source_context.pb.go +++ b/types/source_context.pb.go @@ -48,8 +48,7 @@ func (m *SourceContext) XXX_Marshal(b []byte, deterministic bool) ([]byte, error if deterministic { return xxx_messageInfo_SourceContext.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/struct.pb.go b/types/struct.pb.go index deffae83ab..7c87a085e0 100644 --- a/types/struct.pb.go +++ b/types/struct.pb.go @@ -82,8 +82,7 @@ func (m *Struct) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Struct.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -148,8 +147,7 @@ func (m *Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Value.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -291,8 +289,7 @@ func (m *ListValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_ListValue.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/timestamp.pb.go b/types/timestamp.pb.go index bdbfe18c7b..c02ba2aa18 100644 --- a/types/timestamp.pb.go +++ b/types/timestamp.pb.go @@ -137,8 +137,7 @@ func (m *Timestamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Timestamp.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/type.pb.go b/types/type.pb.go index a3a4f354e9..f251ae77ec 100644 --- a/types/type.pb.go +++ b/types/type.pb.go @@ -205,8 +205,7 @@ func (m *Type) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Type.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -312,8 +311,7 @@ func (m *Field) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Field.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -435,8 +433,7 @@ func (m *Enum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Enum.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -519,8 +516,7 @@ func (m *EnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_EnumValue.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -594,8 +590,7 @@ func (m *Option) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Option.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/types/wrappers.pb.go b/types/wrappers.pb.go index 5628dffa40..34dfc61d13 100644 --- a/types/wrappers.pb.go +++ b/types/wrappers.pb.go @@ -50,8 +50,7 @@ func (m *DoubleValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_DoubleValue.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -105,8 +104,7 @@ func (m *FloatValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_FloatValue.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -160,8 +158,7 @@ func (m *Int64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Int64Value.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -215,8 +212,7 @@ func (m *UInt64Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_UInt64Value.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -270,8 +266,7 @@ func (m *Int32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Int32Value.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -325,8 +320,7 @@ func (m *UInt32Value) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_UInt32Value.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -380,8 +374,7 @@ func (m *BoolValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_BoolValue.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -435,8 +428,7 @@ func (m *StringValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) if deterministic { return xxx_messageInfo_StringValue.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } @@ -490,8 +482,7 @@ func (m *BytesValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_BytesValue.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/fast/gogovanity.pb.go b/vanity/test/fast/gogovanity.pb.go index b55a07177b..3b77e8a042 100644 --- a/vanity/test/fast/gogovanity.pb.go +++ b/vanity/test/fast/gogovanity.pb.go @@ -45,8 +45,7 @@ func (m *B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_B.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/fast/proto3.pb.go b/vanity/test/fast/proto3.pb.go index 94252ac382..e3b366132c 100644 --- a/vanity/test/fast/proto3.pb.go +++ b/vanity/test/fast/proto3.pb.go @@ -42,8 +42,7 @@ func (m *Aproto3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Aproto3.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/fast/vanity.pb.go b/vanity/test/fast/vanity.pb.go index 0bc25790d7..df47b8fa79 100644 --- a/vanity/test/fast/vanity.pb.go +++ b/vanity/test/fast/vanity.pb.go @@ -44,8 +44,7 @@ func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_A.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/faster/gogovanity.pb.go b/vanity/test/faster/gogovanity.pb.go index 67a01b30b6..e87759b7e4 100644 --- a/vanity/test/faster/gogovanity.pb.go +++ b/vanity/test/faster/gogovanity.pb.go @@ -42,8 +42,7 @@ func (m *B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_B.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/faster/proto3.pb.go b/vanity/test/faster/proto3.pb.go index 6f6e54d810..46df27bc22 100644 --- a/vanity/test/faster/proto3.pb.go +++ b/vanity/test/faster/proto3.pb.go @@ -39,8 +39,7 @@ func (m *Aproto3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Aproto3.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/faster/vanity.pb.go b/vanity/test/faster/vanity.pb.go index ea93803c9c..b4707644d4 100644 --- a/vanity/test/faster/vanity.pb.go +++ b/vanity/test/faster/vanity.pb.go @@ -41,8 +41,7 @@ func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_A.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/slick/gogovanity.pb.go b/vanity/test/slick/gogovanity.pb.go index 003aa3fd2e..4c9cfc17d8 100644 --- a/vanity/test/slick/gogovanity.pb.go +++ b/vanity/test/slick/gogovanity.pb.go @@ -43,8 +43,7 @@ func (m *B) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_B.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/slick/proto3.pb.go b/vanity/test/slick/proto3.pb.go index 6c5e00bea3..c2a132a64f 100644 --- a/vanity/test/slick/proto3.pb.go +++ b/vanity/test/slick/proto3.pb.go @@ -40,8 +40,7 @@ func (m *Aproto3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Aproto3.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err } diff --git a/vanity/test/slick/vanity.pb.go b/vanity/test/slick/vanity.pb.go index 7c17b39094..69a2ba41f7 100644 --- a/vanity/test/slick/vanity.pb.go +++ b/vanity/test/slick/vanity.pb.go @@ -42,8 +42,7 @@ func (m *A) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_A.Marshal(b, m, deterministic) } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) + n, err := m.MarshalTo(b) if err != nil { return nil, err }