diff --git a/internal/cmd/pdatagen/internal/templates/message.go.tmpl b/internal/cmd/pdatagen/internal/templates/message.go.tmpl index e8dd90f14a..8576c1a044 100644 --- a/internal/cmd/pdatagen/internal/templates/message.go.tmpl +++ b/internal/cmd/pdatagen/internal/templates/message.go.tmpl @@ -41,7 +41,7 @@ func new{{ .structName }}(orig *{{ .originFullName }}, state *internal.State) {{ // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func New{{ .structName }}() {{ .structName }} { - return new{{ .structName }}(&{{ .originFullName }}{}, internal.NewState()) + return new{{ .structName }}(internal.NewOrigPtr{{ .originName }}(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/internal/cmd/pdatagen/internal/templates/message_internal.go.tmpl b/internal/cmd/pdatagen/internal/templates/message_internal.go.tmpl index 337f4990ea..3f9f39be8b 100644 --- a/internal/cmd/pdatagen/internal/templates/message_internal.go.tmpl +++ b/internal/cmd/pdatagen/internal/templates/message_internal.go.tmpl @@ -31,9 +31,9 @@ func New{{ .structName }}(orig *{{ .originFullName }}, state *State) {{ .structN } func GenerateTest{{ .structName }}() {{ .structName }} { - orig := {{ .originFullName }}{} - FillOrigTest{{ .originName }}(&orig) - return New{{ .structName }}(&orig, NewState()) + orig := NewOrigPtr{{ .originName }}() + FillOrigTest{{ .originName }}(orig) + return New{{ .structName }}(orig, NewState()) } {{ end }} diff --git a/internal/cmd/pdatagen/internal/templates/message_internal_test.go.tmpl b/internal/cmd/pdatagen/internal/templates/message_internal_test.go.tmpl index 9d78c6078c..b4321e2fc2 100644 --- a/internal/cmd/pdatagen/internal/templates/message_internal_test.go.tmpl +++ b/internal/cmd/pdatagen/internal/templates/message_internal_test.go.tmpl @@ -13,10 +13,10 @@ import ( ) func TestCopyOrig{{ .originName }}(t *testing.T) { - src := &{{ .originFullName }}{} - dest := &{{ .originFullName }}{} + src := NewOrigPtr{{ .originName }}() + dest := NewOrigPtr{{ .originName }}() CopyOrig{{ .originName }}(dest, src) - assert.Equal(t, &{{ .originFullName }}{}, dest) + assert.Equal(t, NewOrigPtr{{ .originName }}(), dest) FillOrigTest{{ .originName }}(src) CopyOrig{{ .originName }}(dest, src) assert.Equal(t, src, dest) @@ -25,10 +25,10 @@ func TestCopyOrig{{ .originName }}(t *testing.T) { func TestMarshalAndUnmarshalJSONOrig{{ .originName }}Unknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &{{ .originFullName }}{} + dest := NewOrigPtr{{ .originName }}() UnmarshalJSONOrig{{ .originName }}(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &{{ .originFullName }}{}, dest) + assert.Equal(t, NewOrigPtr{{ .originName }}(), dest) } func TestMarshalAndUnmarshalJSONOrig{{ .originName }}(t *testing.T) { @@ -41,7 +41,7 @@ func TestMarshalAndUnmarshalJSONOrig{{ .originName }}(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &{{ .originFullName }}{} + dest := NewOrigPtr{{ .originName }}() UnmarshalJSONOrig{{ .originName }}(dest, iter) require.NoError(t, iter.Error()) @@ -51,10 +51,10 @@ func TestMarshalAndUnmarshalJSONOrig{{ .originName }}(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrig{{ .originName }}Unknown(t *testing.T) { - dest := &{{ .originFullName }}{} + dest := NewOrigPtr{{ .originName }}() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrig{{ .originName }}(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &{{ .originFullName }}{}, dest) + assert.Equal(t, NewOrigPtr{{ .originName }}(), dest) } func TestMarshalAndUnmarshalProtoOrig{{ .originName }}(t *testing.T) { @@ -64,7 +64,7 @@ func TestMarshalAndUnmarshalProtoOrig{{ .originName }}(t *testing.T) { gotSize := MarshalProtoOrig{{ .originName }}(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &{{ .originFullName }}{} + dest := NewOrigPtr{{ .originName }}() require.NoError(t, UnmarshalProtoOrig{{ .originName }}(dest, buf)) assert.Equal(t, src, dest) }) @@ -84,7 +84,7 @@ func TestMarshalAndUnmarshalProtoViaProtobuf{{ .originName }}(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &{{ .originFullName }}{} + dest := NewOrigPtr{{ .originName }}() require.NoError(t, UnmarshalProtoOrig{{ .originName }}(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -93,9 +93,9 @@ func TestMarshalAndUnmarshalProtoViaProtobuf{{ .originName }}(t *testing.T) { func getEncodingTestValues{{ .originName }}() map[string]*{{ .originFullName }} { return map[string]*{{ .originFullName }}{ - "empty": &{{ .originFullName }}{}, + "empty": NewOrigPtr{{ .originName }}(), "fill_test": func() *{{ .originFullName }} { - src := &{{ .originFullName }}{} + src := NewOrigPtr{{ .originName }}() FillOrigTest{{ .originName }}(src) return src }(), {{ range .fields -}}{{ .GenerateTestValue $.messageStruct }}{{ end }} diff --git a/internal/cmd/pdatagen/internal/templates/message_test.go.tmpl b/internal/cmd/pdatagen/internal/templates/message_test.go.tmpl index 56b43bd770..20f2661142 100644 --- a/internal/cmd/pdatagen/internal/templates/message_test.go.tmpl +++ b/internal/cmd/pdatagen/internal/templates/message_test.go.tmpl @@ -22,8 +22,8 @@ func Test{{ .structName }}_MoveTo(t *testing.T) { assert.Equal(t, generateTest{{ .structName }}(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(new{{ .structName }}(&{{ .originFullName }}{}, sharedState)) }) - assert.Panics(t, func() { new{{ .structName }}(&{{ .originFullName }}{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(new{{ .structName }}(internal.NewOrigPtr{{ .originName }}(), sharedState)) }) + assert.Panics(t, func() { new{{ .structName }}(internal.NewOrigPtr{{ .originName }}(), sharedState).MoveTo(dest) }) } func Test{{ .structName }}_CopyTo(t *testing.T) { @@ -36,7 +36,7 @@ func Test{{ .structName }}_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(new{{ .structName }}(&{{ .originFullName }}{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(new{{ .structName }}(internal.NewOrigPtr{{ .originName }}(), sharedState)) }) } {{ range .fields }} diff --git a/pdata/internal/generated_wrapper_attributeunit_test.go b/pdata/internal/generated_wrapper_attributeunit_test.go index 4a8a770fab..14b2818d31 100644 --- a/pdata/internal/generated_wrapper_attributeunit_test.go +++ b/pdata/internal/generated_wrapper_attributeunit_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigAttributeUnit(t *testing.T) { - src := &otlpprofiles.AttributeUnit{} - dest := &otlpprofiles.AttributeUnit{} + src := NewOrigPtrAttributeUnit() + dest := NewOrigPtrAttributeUnit() CopyOrigAttributeUnit(dest, src) - assert.Equal(t, &otlpprofiles.AttributeUnit{}, dest) + assert.Equal(t, NewOrigPtrAttributeUnit(), dest) FillOrigTestAttributeUnit(src) CopyOrigAttributeUnit(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigAttributeUnit(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigAttributeUnitUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.AttributeUnit{} + dest := NewOrigPtrAttributeUnit() UnmarshalJSONOrigAttributeUnit(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.AttributeUnit{}, dest) + assert.Equal(t, NewOrigPtrAttributeUnit(), dest) } func TestMarshalAndUnmarshalJSONOrigAttributeUnit(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigAttributeUnit(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.AttributeUnit{} + dest := NewOrigPtrAttributeUnit() UnmarshalJSONOrigAttributeUnit(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigAttributeUnit(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigAttributeUnitUnknown(t *testing.T) { - dest := &otlpprofiles.AttributeUnit{} + dest := NewOrigPtrAttributeUnit() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigAttributeUnit(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.AttributeUnit{}, dest) + assert.Equal(t, NewOrigPtrAttributeUnit(), dest) } func TestMarshalAndUnmarshalProtoOrigAttributeUnit(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigAttributeUnit(t *testing.T) { gotSize := MarshalProtoOrigAttributeUnit(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.AttributeUnit{} + dest := NewOrigPtrAttributeUnit() require.NoError(t, UnmarshalProtoOrigAttributeUnit(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufAttributeUnit(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.AttributeUnit{} + dest := NewOrigPtrAttributeUnit() require.NoError(t, UnmarshalProtoOrigAttributeUnit(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufAttributeUnit(t *testing.T) { func getEncodingTestValuesAttributeUnit() map[string]*otlpprofiles.AttributeUnit { return map[string]*otlpprofiles.AttributeUnit{ - "empty": {}, + "empty": NewOrigPtrAttributeUnit(), "fill_test": func() *otlpprofiles.AttributeUnit { - src := &otlpprofiles.AttributeUnit{} + src := NewOrigPtrAttributeUnit() FillOrigTestAttributeUnit(src) return src }(), diff --git a/pdata/internal/generated_wrapper_entityref.go b/pdata/internal/generated_wrapper_entityref.go index 5de601f661..3792cf34c9 100644 --- a/pdata/internal/generated_wrapper_entityref.go +++ b/pdata/internal/generated_wrapper_entityref.go @@ -32,9 +32,9 @@ func NewEntityRef(orig *otlpcommon.EntityRef, state *State) EntityRef { } func GenerateTestEntityRef() EntityRef { - orig := otlpcommon.EntityRef{} - FillOrigTestEntityRef(&orig) - return NewEntityRef(&orig, NewState()) + orig := NewOrigPtrEntityRef() + FillOrigTestEntityRef(orig) + return NewEntityRef(orig, NewState()) } func NewOrigEntityRef() otlpcommon.EntityRef { diff --git a/pdata/internal/generated_wrapper_entityref_test.go b/pdata/internal/generated_wrapper_entityref_test.go index 67fc98c726..6618d07406 100644 --- a/pdata/internal/generated_wrapper_entityref_test.go +++ b/pdata/internal/generated_wrapper_entityref_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigEntityRef(t *testing.T) { - src := &otlpcommon.EntityRef{} - dest := &otlpcommon.EntityRef{} + src := NewOrigPtrEntityRef() + dest := NewOrigPtrEntityRef() CopyOrigEntityRef(dest, src) - assert.Equal(t, &otlpcommon.EntityRef{}, dest) + assert.Equal(t, NewOrigPtrEntityRef(), dest) FillOrigTestEntityRef(src) CopyOrigEntityRef(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigEntityRef(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigEntityRefUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcommon.EntityRef{} + dest := NewOrigPtrEntityRef() UnmarshalJSONOrigEntityRef(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcommon.EntityRef{}, dest) + assert.Equal(t, NewOrigPtrEntityRef(), dest) } func TestMarshalAndUnmarshalJSONOrigEntityRef(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigEntityRef(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcommon.EntityRef{} + dest := NewOrigPtrEntityRef() UnmarshalJSONOrigEntityRef(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigEntityRef(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigEntityRefUnknown(t *testing.T) { - dest := &otlpcommon.EntityRef{} + dest := NewOrigPtrEntityRef() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigEntityRef(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcommon.EntityRef{}, dest) + assert.Equal(t, NewOrigPtrEntityRef(), dest) } func TestMarshalAndUnmarshalProtoOrigEntityRef(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigEntityRef(t *testing.T) { gotSize := MarshalProtoOrigEntityRef(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcommon.EntityRef{} + dest := NewOrigPtrEntityRef() require.NoError(t, UnmarshalProtoOrigEntityRef(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufEntityRef(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcommon.EntityRef{} + dest := NewOrigPtrEntityRef() require.NoError(t, UnmarshalProtoOrigEntityRef(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufEntityRef(t *testing.T) { func getEncodingTestValuesEntityRef() map[string]*otlpcommon.EntityRef { return map[string]*otlpcommon.EntityRef{ - "empty": {}, + "empty": NewOrigPtrEntityRef(), "fill_test": func() *otlpcommon.EntityRef { - src := &otlpcommon.EntityRef{} + src := NewOrigPtrEntityRef() FillOrigTestEntityRef(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exemplar_test.go b/pdata/internal/generated_wrapper_exemplar_test.go index 2b877d081d..1f6d1c48db 100644 --- a/pdata/internal/generated_wrapper_exemplar_test.go +++ b/pdata/internal/generated_wrapper_exemplar_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExemplar(t *testing.T) { - src := &otlpmetrics.Exemplar{} - dest := &otlpmetrics.Exemplar{} + src := NewOrigPtrExemplar() + dest := NewOrigPtrExemplar() CopyOrigExemplar(dest, src) - assert.Equal(t, &otlpmetrics.Exemplar{}, dest) + assert.Equal(t, NewOrigPtrExemplar(), dest) FillOrigTestExemplar(src) CopyOrigExemplar(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExemplar(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExemplarUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Exemplar{} + dest := NewOrigPtrExemplar() UnmarshalJSONOrigExemplar(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.Exemplar{}, dest) + assert.Equal(t, NewOrigPtrExemplar(), dest) } func TestMarshalAndUnmarshalJSONOrigExemplar(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExemplar(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Exemplar{} + dest := NewOrigPtrExemplar() UnmarshalJSONOrigExemplar(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExemplar(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExemplarUnknown(t *testing.T) { - dest := &otlpmetrics.Exemplar{} + dest := NewOrigPtrExemplar() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExemplar(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.Exemplar{}, dest) + assert.Equal(t, NewOrigPtrExemplar(), dest) } func TestMarshalAndUnmarshalProtoOrigExemplar(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExemplar(t *testing.T) { gotSize := MarshalProtoOrigExemplar(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.Exemplar{} + dest := NewOrigPtrExemplar() require.NoError(t, UnmarshalProtoOrigExemplar(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExemplar(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.Exemplar{} + dest := NewOrigPtrExemplar() require.NoError(t, UnmarshalProtoOrigExemplar(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExemplar(t *testing.T) { func getEncodingTestValuesExemplar() map[string]*otlpmetrics.Exemplar { return map[string]*otlpmetrics.Exemplar{ - "empty": {}, + "empty": NewOrigPtrExemplar(), "fill_test": func() *otlpmetrics.Exemplar { - src := &otlpmetrics.Exemplar{} + src := NewOrigPtrExemplar() FillOrigTestExemplar(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exponentialhistogram_test.go b/pdata/internal/generated_wrapper_exponentialhistogram_test.go index 254a1f665b..44f5965bb6 100644 --- a/pdata/internal/generated_wrapper_exponentialhistogram_test.go +++ b/pdata/internal/generated_wrapper_exponentialhistogram_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExponentialHistogram(t *testing.T) { - src := &otlpmetrics.ExponentialHistogram{} - dest := &otlpmetrics.ExponentialHistogram{} + src := NewOrigPtrExponentialHistogram() + dest := NewOrigPtrExponentialHistogram() CopyOrigExponentialHistogram(dest, src) - assert.Equal(t, &otlpmetrics.ExponentialHistogram{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogram(), dest) FillOrigTestExponentialHistogram(src) CopyOrigExponentialHistogram(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExponentialHistogram(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExponentialHistogramUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ExponentialHistogram{} + dest := NewOrigPtrExponentialHistogram() UnmarshalJSONOrigExponentialHistogram(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.ExponentialHistogram{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogram(), dest) } func TestMarshalAndUnmarshalJSONOrigExponentialHistogram(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExponentialHistogram(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ExponentialHistogram{} + dest := NewOrigPtrExponentialHistogram() UnmarshalJSONOrigExponentialHistogram(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExponentialHistogram(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExponentialHistogramUnknown(t *testing.T) { - dest := &otlpmetrics.ExponentialHistogram{} + dest := NewOrigPtrExponentialHistogram() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExponentialHistogram(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.ExponentialHistogram{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogram(), dest) } func TestMarshalAndUnmarshalProtoOrigExponentialHistogram(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExponentialHistogram(t *testing.T) { gotSize := MarshalProtoOrigExponentialHistogram(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.ExponentialHistogram{} + dest := NewOrigPtrExponentialHistogram() require.NoError(t, UnmarshalProtoOrigExponentialHistogram(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExponentialHistogram(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.ExponentialHistogram{} + dest := NewOrigPtrExponentialHistogram() require.NoError(t, UnmarshalProtoOrigExponentialHistogram(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExponentialHistogram(t *testing.T) { func getEncodingTestValuesExponentialHistogram() map[string]*otlpmetrics.ExponentialHistogram { return map[string]*otlpmetrics.ExponentialHistogram{ - "empty": {}, + "empty": NewOrigPtrExponentialHistogram(), "fill_test": func() *otlpmetrics.ExponentialHistogram { - src := &otlpmetrics.ExponentialHistogram{} + src := NewOrigPtrExponentialHistogram() FillOrigTestExponentialHistogram(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exponentialhistogramdatapoint_buckets_test.go b/pdata/internal/generated_wrapper_exponentialhistogramdatapoint_buckets_test.go index 7052602549..18dcd6d6a4 100644 --- a/pdata/internal/generated_wrapper_exponentialhistogramdatapoint_buckets_test.go +++ b/pdata/internal/generated_wrapper_exponentialhistogramdatapoint_buckets_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExponentialHistogramDataPoint_Buckets(t *testing.T) { - src := &otlpmetrics.ExponentialHistogramDataPoint_Buckets{} - dest := &otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + src := NewOrigPtrExponentialHistogramDataPoint_Buckets() + dest := NewOrigPtrExponentialHistogramDataPoint_Buckets() CopyOrigExponentialHistogramDataPoint_Buckets(dest, src) - assert.Equal(t, &otlpmetrics.ExponentialHistogramDataPoint_Buckets{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogramDataPoint_Buckets(), dest) FillOrigTestExponentialHistogramDataPoint_Buckets(src) CopyOrigExponentialHistogramDataPoint_Buckets(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExponentialHistogramDataPoint_Buckets(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExponentialHistogramDataPoint_BucketsUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + dest := NewOrigPtrExponentialHistogramDataPoint_Buckets() UnmarshalJSONOrigExponentialHistogramDataPoint_Buckets(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.ExponentialHistogramDataPoint_Buckets{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogramDataPoint_Buckets(), dest) } func TestMarshalAndUnmarshalJSONOrigExponentialHistogramDataPoint_Buckets(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExponentialHistogramDataPoint_Buckets(t *tes iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + dest := NewOrigPtrExponentialHistogramDataPoint_Buckets() UnmarshalJSONOrigExponentialHistogramDataPoint_Buckets(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExponentialHistogramDataPoint_Buckets(t *tes } func TestMarshalAndUnmarshalProtoOrigExponentialHistogramDataPoint_BucketsUnknown(t *testing.T) { - dest := &otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + dest := NewOrigPtrExponentialHistogramDataPoint_Buckets() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExponentialHistogramDataPoint_Buckets(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.ExponentialHistogramDataPoint_Buckets{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogramDataPoint_Buckets(), dest) } func TestMarshalAndUnmarshalProtoOrigExponentialHistogramDataPoint_Buckets(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExponentialHistogramDataPoint_Buckets(t *te gotSize := MarshalProtoOrigExponentialHistogramDataPoint_Buckets(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + dest := NewOrigPtrExponentialHistogramDataPoint_Buckets() require.NoError(t, UnmarshalProtoOrigExponentialHistogramDataPoint_Buckets(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExponentialHistogramDataPoint_Bucket goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + dest := NewOrigPtrExponentialHistogramDataPoint_Buckets() require.NoError(t, UnmarshalProtoOrigExponentialHistogramDataPoint_Buckets(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExponentialHistogramDataPoint_Bucket func getEncodingTestValuesExponentialHistogramDataPoint_Buckets() map[string]*otlpmetrics.ExponentialHistogramDataPoint_Buckets { return map[string]*otlpmetrics.ExponentialHistogramDataPoint_Buckets{ - "empty": {}, + "empty": NewOrigPtrExponentialHistogramDataPoint_Buckets(), "fill_test": func() *otlpmetrics.ExponentialHistogramDataPoint_Buckets { - src := &otlpmetrics.ExponentialHistogramDataPoint_Buckets{} + src := NewOrigPtrExponentialHistogramDataPoint_Buckets() FillOrigTestExponentialHistogramDataPoint_Buckets(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exponentialhistogramdatapoint_test.go b/pdata/internal/generated_wrapper_exponentialhistogramdatapoint_test.go index 84683697e4..31a38122da 100644 --- a/pdata/internal/generated_wrapper_exponentialhistogramdatapoint_test.go +++ b/pdata/internal/generated_wrapper_exponentialhistogramdatapoint_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExponentialHistogramDataPoint(t *testing.T) { - src := &otlpmetrics.ExponentialHistogramDataPoint{} - dest := &otlpmetrics.ExponentialHistogramDataPoint{} + src := NewOrigPtrExponentialHistogramDataPoint() + dest := NewOrigPtrExponentialHistogramDataPoint() CopyOrigExponentialHistogramDataPoint(dest, src) - assert.Equal(t, &otlpmetrics.ExponentialHistogramDataPoint{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogramDataPoint(), dest) FillOrigTestExponentialHistogramDataPoint(src) CopyOrigExponentialHistogramDataPoint(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExponentialHistogramDataPoint(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExponentialHistogramDataPointUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ExponentialHistogramDataPoint{} + dest := NewOrigPtrExponentialHistogramDataPoint() UnmarshalJSONOrigExponentialHistogramDataPoint(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.ExponentialHistogramDataPoint{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogramDataPoint(), dest) } func TestMarshalAndUnmarshalJSONOrigExponentialHistogramDataPoint(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExponentialHistogramDataPoint(t *testing.T) iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ExponentialHistogramDataPoint{} + dest := NewOrigPtrExponentialHistogramDataPoint() UnmarshalJSONOrigExponentialHistogramDataPoint(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExponentialHistogramDataPoint(t *testing.T) } func TestMarshalAndUnmarshalProtoOrigExponentialHistogramDataPointUnknown(t *testing.T) { - dest := &otlpmetrics.ExponentialHistogramDataPoint{} + dest := NewOrigPtrExponentialHistogramDataPoint() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExponentialHistogramDataPoint(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.ExponentialHistogramDataPoint{}, dest) + assert.Equal(t, NewOrigPtrExponentialHistogramDataPoint(), dest) } func TestMarshalAndUnmarshalProtoOrigExponentialHistogramDataPoint(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExponentialHistogramDataPoint(t *testing.T) gotSize := MarshalProtoOrigExponentialHistogramDataPoint(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.ExponentialHistogramDataPoint{} + dest := NewOrigPtrExponentialHistogramDataPoint() require.NoError(t, UnmarshalProtoOrigExponentialHistogramDataPoint(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExponentialHistogramDataPoint(t *tes goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.ExponentialHistogramDataPoint{} + dest := NewOrigPtrExponentialHistogramDataPoint() require.NoError(t, UnmarshalProtoOrigExponentialHistogramDataPoint(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExponentialHistogramDataPoint(t *tes func getEncodingTestValuesExponentialHistogramDataPoint() map[string]*otlpmetrics.ExponentialHistogramDataPoint { return map[string]*otlpmetrics.ExponentialHistogramDataPoint{ - "empty": {}, + "empty": NewOrigPtrExponentialHistogramDataPoint(), "fill_test": func() *otlpmetrics.ExponentialHistogramDataPoint { - src := &otlpmetrics.ExponentialHistogramDataPoint{} + src := NewOrigPtrExponentialHistogramDataPoint() FillOrigTestExponentialHistogramDataPoint(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportlogspartialsuccess_test.go b/pdata/internal/generated_wrapper_exportlogspartialsuccess_test.go index 6e40099348..bf176555e2 100644 --- a/pdata/internal/generated_wrapper_exportlogspartialsuccess_test.go +++ b/pdata/internal/generated_wrapper_exportlogspartialsuccess_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportLogsPartialSuccess(t *testing.T) { - src := &otlpcollectorlogs.ExportLogsPartialSuccess{} - dest := &otlpcollectorlogs.ExportLogsPartialSuccess{} + src := NewOrigPtrExportLogsPartialSuccess() + dest := NewOrigPtrExportLogsPartialSuccess() CopyOrigExportLogsPartialSuccess(dest, src) - assert.Equal(t, &otlpcollectorlogs.ExportLogsPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportLogsPartialSuccess(), dest) FillOrigTestExportLogsPartialSuccess(src) CopyOrigExportLogsPartialSuccess(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportLogsPartialSuccess(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportLogsPartialSuccessUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectorlogs.ExportLogsPartialSuccess{} + dest := NewOrigPtrExportLogsPartialSuccess() UnmarshalJSONOrigExportLogsPartialSuccess(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectorlogs.ExportLogsPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportLogsPartialSuccess(), dest) } func TestMarshalAndUnmarshalJSONOrigExportLogsPartialSuccess(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportLogsPartialSuccess(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectorlogs.ExportLogsPartialSuccess{} + dest := NewOrigPtrExportLogsPartialSuccess() UnmarshalJSONOrigExportLogsPartialSuccess(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportLogsPartialSuccess(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportLogsPartialSuccessUnknown(t *testing.T) { - dest := &otlpcollectorlogs.ExportLogsPartialSuccess{} + dest := NewOrigPtrExportLogsPartialSuccess() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportLogsPartialSuccess(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectorlogs.ExportLogsPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportLogsPartialSuccess(), dest) } func TestMarshalAndUnmarshalProtoOrigExportLogsPartialSuccess(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportLogsPartialSuccess(t *testing.T) { gotSize := MarshalProtoOrigExportLogsPartialSuccess(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectorlogs.ExportLogsPartialSuccess{} + dest := NewOrigPtrExportLogsPartialSuccess() require.NoError(t, UnmarshalProtoOrigExportLogsPartialSuccess(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportLogsPartialSuccess(t *testing. goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectorlogs.ExportLogsPartialSuccess{} + dest := NewOrigPtrExportLogsPartialSuccess() require.NoError(t, UnmarshalProtoOrigExportLogsPartialSuccess(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportLogsPartialSuccess(t *testing. func getEncodingTestValuesExportLogsPartialSuccess() map[string]*otlpcollectorlogs.ExportLogsPartialSuccess { return map[string]*otlpcollectorlogs.ExportLogsPartialSuccess{ - "empty": {}, + "empty": NewOrigPtrExportLogsPartialSuccess(), "fill_test": func() *otlpcollectorlogs.ExportLogsPartialSuccess { - src := &otlpcollectorlogs.ExportLogsPartialSuccess{} + src := NewOrigPtrExportLogsPartialSuccess() FillOrigTestExportLogsPartialSuccess(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportlogsservicerequest.go b/pdata/internal/generated_wrapper_exportlogsservicerequest.go index 07701f8a50..1d91e7623a 100644 --- a/pdata/internal/generated_wrapper_exportlogsservicerequest.go +++ b/pdata/internal/generated_wrapper_exportlogsservicerequest.go @@ -32,9 +32,9 @@ func NewLogs(orig *otlpcollectorlogs.ExportLogsServiceRequest, state *State) Log } func GenerateTestLogs() Logs { - orig := otlpcollectorlogs.ExportLogsServiceRequest{} - FillOrigTestExportLogsServiceRequest(&orig) - return NewLogs(&orig, NewState()) + orig := NewOrigPtrExportLogsServiceRequest() + FillOrigTestExportLogsServiceRequest(orig) + return NewLogs(orig, NewState()) } func NewOrigExportLogsServiceRequest() otlpcollectorlogs.ExportLogsServiceRequest { diff --git a/pdata/internal/generated_wrapper_exportlogsservicerequest_test.go b/pdata/internal/generated_wrapper_exportlogsservicerequest_test.go index 18bdaa315d..b44fd05203 100644 --- a/pdata/internal/generated_wrapper_exportlogsservicerequest_test.go +++ b/pdata/internal/generated_wrapper_exportlogsservicerequest_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportLogsServiceRequest(t *testing.T) { - src := &otlpcollectorlogs.ExportLogsServiceRequest{} - dest := &otlpcollectorlogs.ExportLogsServiceRequest{} + src := NewOrigPtrExportLogsServiceRequest() + dest := NewOrigPtrExportLogsServiceRequest() CopyOrigExportLogsServiceRequest(dest, src) - assert.Equal(t, &otlpcollectorlogs.ExportLogsServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportLogsServiceRequest(), dest) FillOrigTestExportLogsServiceRequest(src) CopyOrigExportLogsServiceRequest(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportLogsServiceRequest(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportLogsServiceRequestUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectorlogs.ExportLogsServiceRequest{} + dest := NewOrigPtrExportLogsServiceRequest() UnmarshalJSONOrigExportLogsServiceRequest(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectorlogs.ExportLogsServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportLogsServiceRequest(), dest) } func TestMarshalAndUnmarshalJSONOrigExportLogsServiceRequest(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportLogsServiceRequest(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectorlogs.ExportLogsServiceRequest{} + dest := NewOrigPtrExportLogsServiceRequest() UnmarshalJSONOrigExportLogsServiceRequest(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportLogsServiceRequest(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportLogsServiceRequestUnknown(t *testing.T) { - dest := &otlpcollectorlogs.ExportLogsServiceRequest{} + dest := NewOrigPtrExportLogsServiceRequest() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportLogsServiceRequest(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectorlogs.ExportLogsServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportLogsServiceRequest(), dest) } func TestMarshalAndUnmarshalProtoOrigExportLogsServiceRequest(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportLogsServiceRequest(t *testing.T) { gotSize := MarshalProtoOrigExportLogsServiceRequest(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectorlogs.ExportLogsServiceRequest{} + dest := NewOrigPtrExportLogsServiceRequest() require.NoError(t, UnmarshalProtoOrigExportLogsServiceRequest(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportLogsServiceRequest(t *testing. goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectorlogs.ExportLogsServiceRequest{} + dest := NewOrigPtrExportLogsServiceRequest() require.NoError(t, UnmarshalProtoOrigExportLogsServiceRequest(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportLogsServiceRequest(t *testing. func getEncodingTestValuesExportLogsServiceRequest() map[string]*otlpcollectorlogs.ExportLogsServiceRequest { return map[string]*otlpcollectorlogs.ExportLogsServiceRequest{ - "empty": {}, + "empty": NewOrigPtrExportLogsServiceRequest(), "fill_test": func() *otlpcollectorlogs.ExportLogsServiceRequest { - src := &otlpcollectorlogs.ExportLogsServiceRequest{} + src := NewOrigPtrExportLogsServiceRequest() FillOrigTestExportLogsServiceRequest(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportlogsserviceresponse_test.go b/pdata/internal/generated_wrapper_exportlogsserviceresponse_test.go index 8441d132a4..c9dc0a2a81 100644 --- a/pdata/internal/generated_wrapper_exportlogsserviceresponse_test.go +++ b/pdata/internal/generated_wrapper_exportlogsserviceresponse_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportLogsServiceResponse(t *testing.T) { - src := &otlpcollectorlogs.ExportLogsServiceResponse{} - dest := &otlpcollectorlogs.ExportLogsServiceResponse{} + src := NewOrigPtrExportLogsServiceResponse() + dest := NewOrigPtrExportLogsServiceResponse() CopyOrigExportLogsServiceResponse(dest, src) - assert.Equal(t, &otlpcollectorlogs.ExportLogsServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportLogsServiceResponse(), dest) FillOrigTestExportLogsServiceResponse(src) CopyOrigExportLogsServiceResponse(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportLogsServiceResponse(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportLogsServiceResponseUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectorlogs.ExportLogsServiceResponse{} + dest := NewOrigPtrExportLogsServiceResponse() UnmarshalJSONOrigExportLogsServiceResponse(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectorlogs.ExportLogsServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportLogsServiceResponse(), dest) } func TestMarshalAndUnmarshalJSONOrigExportLogsServiceResponse(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportLogsServiceResponse(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectorlogs.ExportLogsServiceResponse{} + dest := NewOrigPtrExportLogsServiceResponse() UnmarshalJSONOrigExportLogsServiceResponse(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportLogsServiceResponse(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportLogsServiceResponseUnknown(t *testing.T) { - dest := &otlpcollectorlogs.ExportLogsServiceResponse{} + dest := NewOrigPtrExportLogsServiceResponse() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportLogsServiceResponse(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectorlogs.ExportLogsServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportLogsServiceResponse(), dest) } func TestMarshalAndUnmarshalProtoOrigExportLogsServiceResponse(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportLogsServiceResponse(t *testing.T) { gotSize := MarshalProtoOrigExportLogsServiceResponse(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectorlogs.ExportLogsServiceResponse{} + dest := NewOrigPtrExportLogsServiceResponse() require.NoError(t, UnmarshalProtoOrigExportLogsServiceResponse(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportLogsServiceResponse(t *testing goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectorlogs.ExportLogsServiceResponse{} + dest := NewOrigPtrExportLogsServiceResponse() require.NoError(t, UnmarshalProtoOrigExportLogsServiceResponse(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportLogsServiceResponse(t *testing func getEncodingTestValuesExportLogsServiceResponse() map[string]*otlpcollectorlogs.ExportLogsServiceResponse { return map[string]*otlpcollectorlogs.ExportLogsServiceResponse{ - "empty": {}, + "empty": NewOrigPtrExportLogsServiceResponse(), "fill_test": func() *otlpcollectorlogs.ExportLogsServiceResponse { - src := &otlpcollectorlogs.ExportLogsServiceResponse{} + src := NewOrigPtrExportLogsServiceResponse() FillOrigTestExportLogsServiceResponse(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportmetricspartialsuccess_test.go b/pdata/internal/generated_wrapper_exportmetricspartialsuccess_test.go index 420b005da0..c5ed647c16 100644 --- a/pdata/internal/generated_wrapper_exportmetricspartialsuccess_test.go +++ b/pdata/internal/generated_wrapper_exportmetricspartialsuccess_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportMetricsPartialSuccess(t *testing.T) { - src := &otlpcollectormetrics.ExportMetricsPartialSuccess{} - dest := &otlpcollectormetrics.ExportMetricsPartialSuccess{} + src := NewOrigPtrExportMetricsPartialSuccess() + dest := NewOrigPtrExportMetricsPartialSuccess() CopyOrigExportMetricsPartialSuccess(dest, src) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsPartialSuccess(), dest) FillOrigTestExportMetricsPartialSuccess(src) CopyOrigExportMetricsPartialSuccess(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportMetricsPartialSuccess(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportMetricsPartialSuccessUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectormetrics.ExportMetricsPartialSuccess{} + dest := NewOrigPtrExportMetricsPartialSuccess() UnmarshalJSONOrigExportMetricsPartialSuccess(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsPartialSuccess(), dest) } func TestMarshalAndUnmarshalJSONOrigExportMetricsPartialSuccess(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportMetricsPartialSuccess(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectormetrics.ExportMetricsPartialSuccess{} + dest := NewOrigPtrExportMetricsPartialSuccess() UnmarshalJSONOrigExportMetricsPartialSuccess(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportMetricsPartialSuccess(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportMetricsPartialSuccessUnknown(t *testing.T) { - dest := &otlpcollectormetrics.ExportMetricsPartialSuccess{} + dest := NewOrigPtrExportMetricsPartialSuccess() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportMetricsPartialSuccess(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsPartialSuccess(), dest) } func TestMarshalAndUnmarshalProtoOrigExportMetricsPartialSuccess(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportMetricsPartialSuccess(t *testing.T) { gotSize := MarshalProtoOrigExportMetricsPartialSuccess(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectormetrics.ExportMetricsPartialSuccess{} + dest := NewOrigPtrExportMetricsPartialSuccess() require.NoError(t, UnmarshalProtoOrigExportMetricsPartialSuccess(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportMetricsPartialSuccess(t *testi goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectormetrics.ExportMetricsPartialSuccess{} + dest := NewOrigPtrExportMetricsPartialSuccess() require.NoError(t, UnmarshalProtoOrigExportMetricsPartialSuccess(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportMetricsPartialSuccess(t *testi func getEncodingTestValuesExportMetricsPartialSuccess() map[string]*otlpcollectormetrics.ExportMetricsPartialSuccess { return map[string]*otlpcollectormetrics.ExportMetricsPartialSuccess{ - "empty": {}, + "empty": NewOrigPtrExportMetricsPartialSuccess(), "fill_test": func() *otlpcollectormetrics.ExportMetricsPartialSuccess { - src := &otlpcollectormetrics.ExportMetricsPartialSuccess{} + src := NewOrigPtrExportMetricsPartialSuccess() FillOrigTestExportMetricsPartialSuccess(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportmetricsservicerequest.go b/pdata/internal/generated_wrapper_exportmetricsservicerequest.go index ddb3e743ca..81ea053cf0 100644 --- a/pdata/internal/generated_wrapper_exportmetricsservicerequest.go +++ b/pdata/internal/generated_wrapper_exportmetricsservicerequest.go @@ -32,9 +32,9 @@ func NewMetrics(orig *otlpcollectormetrics.ExportMetricsServiceRequest, state *S } func GenerateTestMetrics() Metrics { - orig := otlpcollectormetrics.ExportMetricsServiceRequest{} - FillOrigTestExportMetricsServiceRequest(&orig) - return NewMetrics(&orig, NewState()) + orig := NewOrigPtrExportMetricsServiceRequest() + FillOrigTestExportMetricsServiceRequest(orig) + return NewMetrics(orig, NewState()) } func NewOrigExportMetricsServiceRequest() otlpcollectormetrics.ExportMetricsServiceRequest { diff --git a/pdata/internal/generated_wrapper_exportmetricsservicerequest_test.go b/pdata/internal/generated_wrapper_exportmetricsservicerequest_test.go index 63eebc03a4..fbc00706af 100644 --- a/pdata/internal/generated_wrapper_exportmetricsservicerequest_test.go +++ b/pdata/internal/generated_wrapper_exportmetricsservicerequest_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportMetricsServiceRequest(t *testing.T) { - src := &otlpcollectormetrics.ExportMetricsServiceRequest{} - dest := &otlpcollectormetrics.ExportMetricsServiceRequest{} + src := NewOrigPtrExportMetricsServiceRequest() + dest := NewOrigPtrExportMetricsServiceRequest() CopyOrigExportMetricsServiceRequest(dest, src) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsServiceRequest(), dest) FillOrigTestExportMetricsServiceRequest(src) CopyOrigExportMetricsServiceRequest(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportMetricsServiceRequest(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportMetricsServiceRequestUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectormetrics.ExportMetricsServiceRequest{} + dest := NewOrigPtrExportMetricsServiceRequest() UnmarshalJSONOrigExportMetricsServiceRequest(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsServiceRequest(), dest) } func TestMarshalAndUnmarshalJSONOrigExportMetricsServiceRequest(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportMetricsServiceRequest(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectormetrics.ExportMetricsServiceRequest{} + dest := NewOrigPtrExportMetricsServiceRequest() UnmarshalJSONOrigExportMetricsServiceRequest(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportMetricsServiceRequest(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportMetricsServiceRequestUnknown(t *testing.T) { - dest := &otlpcollectormetrics.ExportMetricsServiceRequest{} + dest := NewOrigPtrExportMetricsServiceRequest() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportMetricsServiceRequest(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsServiceRequest(), dest) } func TestMarshalAndUnmarshalProtoOrigExportMetricsServiceRequest(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportMetricsServiceRequest(t *testing.T) { gotSize := MarshalProtoOrigExportMetricsServiceRequest(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectormetrics.ExportMetricsServiceRequest{} + dest := NewOrigPtrExportMetricsServiceRequest() require.NoError(t, UnmarshalProtoOrigExportMetricsServiceRequest(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportMetricsServiceRequest(t *testi goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectormetrics.ExportMetricsServiceRequest{} + dest := NewOrigPtrExportMetricsServiceRequest() require.NoError(t, UnmarshalProtoOrigExportMetricsServiceRequest(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportMetricsServiceRequest(t *testi func getEncodingTestValuesExportMetricsServiceRequest() map[string]*otlpcollectormetrics.ExportMetricsServiceRequest { return map[string]*otlpcollectormetrics.ExportMetricsServiceRequest{ - "empty": {}, + "empty": NewOrigPtrExportMetricsServiceRequest(), "fill_test": func() *otlpcollectormetrics.ExportMetricsServiceRequest { - src := &otlpcollectormetrics.ExportMetricsServiceRequest{} + src := NewOrigPtrExportMetricsServiceRequest() FillOrigTestExportMetricsServiceRequest(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportmetricsserviceresponse_test.go b/pdata/internal/generated_wrapper_exportmetricsserviceresponse_test.go index 1f41bd99ec..7be4ed4289 100644 --- a/pdata/internal/generated_wrapper_exportmetricsserviceresponse_test.go +++ b/pdata/internal/generated_wrapper_exportmetricsserviceresponse_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportMetricsServiceResponse(t *testing.T) { - src := &otlpcollectormetrics.ExportMetricsServiceResponse{} - dest := &otlpcollectormetrics.ExportMetricsServiceResponse{} + src := NewOrigPtrExportMetricsServiceResponse() + dest := NewOrigPtrExportMetricsServiceResponse() CopyOrigExportMetricsServiceResponse(dest, src) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsServiceResponse(), dest) FillOrigTestExportMetricsServiceResponse(src) CopyOrigExportMetricsServiceResponse(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportMetricsServiceResponse(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportMetricsServiceResponseUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectormetrics.ExportMetricsServiceResponse{} + dest := NewOrigPtrExportMetricsServiceResponse() UnmarshalJSONOrigExportMetricsServiceResponse(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsServiceResponse(), dest) } func TestMarshalAndUnmarshalJSONOrigExportMetricsServiceResponse(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportMetricsServiceResponse(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectormetrics.ExportMetricsServiceResponse{} + dest := NewOrigPtrExportMetricsServiceResponse() UnmarshalJSONOrigExportMetricsServiceResponse(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportMetricsServiceResponse(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportMetricsServiceResponseUnknown(t *testing.T) { - dest := &otlpcollectormetrics.ExportMetricsServiceResponse{} + dest := NewOrigPtrExportMetricsServiceResponse() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportMetricsServiceResponse(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectormetrics.ExportMetricsServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportMetricsServiceResponse(), dest) } func TestMarshalAndUnmarshalProtoOrigExportMetricsServiceResponse(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportMetricsServiceResponse(t *testing.T) gotSize := MarshalProtoOrigExportMetricsServiceResponse(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectormetrics.ExportMetricsServiceResponse{} + dest := NewOrigPtrExportMetricsServiceResponse() require.NoError(t, UnmarshalProtoOrigExportMetricsServiceResponse(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportMetricsServiceResponse(t *test goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectormetrics.ExportMetricsServiceResponse{} + dest := NewOrigPtrExportMetricsServiceResponse() require.NoError(t, UnmarshalProtoOrigExportMetricsServiceResponse(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportMetricsServiceResponse(t *test func getEncodingTestValuesExportMetricsServiceResponse() map[string]*otlpcollectormetrics.ExportMetricsServiceResponse { return map[string]*otlpcollectormetrics.ExportMetricsServiceResponse{ - "empty": {}, + "empty": NewOrigPtrExportMetricsServiceResponse(), "fill_test": func() *otlpcollectormetrics.ExportMetricsServiceResponse { - src := &otlpcollectormetrics.ExportMetricsServiceResponse{} + src := NewOrigPtrExportMetricsServiceResponse() FillOrigTestExportMetricsServiceResponse(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportprofilespartialsuccess_test.go b/pdata/internal/generated_wrapper_exportprofilespartialsuccess_test.go index fda7934652..a4067a6567 100644 --- a/pdata/internal/generated_wrapper_exportprofilespartialsuccess_test.go +++ b/pdata/internal/generated_wrapper_exportprofilespartialsuccess_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportProfilesPartialSuccess(t *testing.T) { - src := &otlpcollectorprofiles.ExportProfilesPartialSuccess{} - dest := &otlpcollectorprofiles.ExportProfilesPartialSuccess{} + src := NewOrigPtrExportProfilesPartialSuccess() + dest := NewOrigPtrExportProfilesPartialSuccess() CopyOrigExportProfilesPartialSuccess(dest, src) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesPartialSuccess(), dest) FillOrigTestExportProfilesPartialSuccess(src) CopyOrigExportProfilesPartialSuccess(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportProfilesPartialSuccess(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportProfilesPartialSuccessUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectorprofiles.ExportProfilesPartialSuccess{} + dest := NewOrigPtrExportProfilesPartialSuccess() UnmarshalJSONOrigExportProfilesPartialSuccess(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesPartialSuccess(), dest) } func TestMarshalAndUnmarshalJSONOrigExportProfilesPartialSuccess(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportProfilesPartialSuccess(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectorprofiles.ExportProfilesPartialSuccess{} + dest := NewOrigPtrExportProfilesPartialSuccess() UnmarshalJSONOrigExportProfilesPartialSuccess(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportProfilesPartialSuccess(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportProfilesPartialSuccessUnknown(t *testing.T) { - dest := &otlpcollectorprofiles.ExportProfilesPartialSuccess{} + dest := NewOrigPtrExportProfilesPartialSuccess() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportProfilesPartialSuccess(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesPartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesPartialSuccess(), dest) } func TestMarshalAndUnmarshalProtoOrigExportProfilesPartialSuccess(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportProfilesPartialSuccess(t *testing.T) gotSize := MarshalProtoOrigExportProfilesPartialSuccess(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectorprofiles.ExportProfilesPartialSuccess{} + dest := NewOrigPtrExportProfilesPartialSuccess() require.NoError(t, UnmarshalProtoOrigExportProfilesPartialSuccess(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportProfilesPartialSuccess(t *test goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectorprofiles.ExportProfilesPartialSuccess{} + dest := NewOrigPtrExportProfilesPartialSuccess() require.NoError(t, UnmarshalProtoOrigExportProfilesPartialSuccess(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportProfilesPartialSuccess(t *test func getEncodingTestValuesExportProfilesPartialSuccess() map[string]*otlpcollectorprofiles.ExportProfilesPartialSuccess { return map[string]*otlpcollectorprofiles.ExportProfilesPartialSuccess{ - "empty": {}, + "empty": NewOrigPtrExportProfilesPartialSuccess(), "fill_test": func() *otlpcollectorprofiles.ExportProfilesPartialSuccess { - src := &otlpcollectorprofiles.ExportProfilesPartialSuccess{} + src := NewOrigPtrExportProfilesPartialSuccess() FillOrigTestExportProfilesPartialSuccess(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportprofilesservicerequest.go b/pdata/internal/generated_wrapper_exportprofilesservicerequest.go index fb5bf55623..c846ba897a 100644 --- a/pdata/internal/generated_wrapper_exportprofilesservicerequest.go +++ b/pdata/internal/generated_wrapper_exportprofilesservicerequest.go @@ -32,9 +32,9 @@ func NewProfiles(orig *otlpcollectorprofiles.ExportProfilesServiceRequest, state } func GenerateTestProfiles() Profiles { - orig := otlpcollectorprofiles.ExportProfilesServiceRequest{} - FillOrigTestExportProfilesServiceRequest(&orig) - return NewProfiles(&orig, NewState()) + orig := NewOrigPtrExportProfilesServiceRequest() + FillOrigTestExportProfilesServiceRequest(orig) + return NewProfiles(orig, NewState()) } func NewOrigExportProfilesServiceRequest() otlpcollectorprofiles.ExportProfilesServiceRequest { diff --git a/pdata/internal/generated_wrapper_exportprofilesservicerequest_test.go b/pdata/internal/generated_wrapper_exportprofilesservicerequest_test.go index 6180ef2f30..28863087c4 100644 --- a/pdata/internal/generated_wrapper_exportprofilesservicerequest_test.go +++ b/pdata/internal/generated_wrapper_exportprofilesservicerequest_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportProfilesServiceRequest(t *testing.T) { - src := &otlpcollectorprofiles.ExportProfilesServiceRequest{} - dest := &otlpcollectorprofiles.ExportProfilesServiceRequest{} + src := NewOrigPtrExportProfilesServiceRequest() + dest := NewOrigPtrExportProfilesServiceRequest() CopyOrigExportProfilesServiceRequest(dest, src) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesServiceRequest(), dest) FillOrigTestExportProfilesServiceRequest(src) CopyOrigExportProfilesServiceRequest(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportProfilesServiceRequest(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportProfilesServiceRequestUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectorprofiles.ExportProfilesServiceRequest{} + dest := NewOrigPtrExportProfilesServiceRequest() UnmarshalJSONOrigExportProfilesServiceRequest(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesServiceRequest(), dest) } func TestMarshalAndUnmarshalJSONOrigExportProfilesServiceRequest(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportProfilesServiceRequest(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectorprofiles.ExportProfilesServiceRequest{} + dest := NewOrigPtrExportProfilesServiceRequest() UnmarshalJSONOrigExportProfilesServiceRequest(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportProfilesServiceRequest(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportProfilesServiceRequestUnknown(t *testing.T) { - dest := &otlpcollectorprofiles.ExportProfilesServiceRequest{} + dest := NewOrigPtrExportProfilesServiceRequest() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportProfilesServiceRequest(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesServiceRequest(), dest) } func TestMarshalAndUnmarshalProtoOrigExportProfilesServiceRequest(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportProfilesServiceRequest(t *testing.T) gotSize := MarshalProtoOrigExportProfilesServiceRequest(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectorprofiles.ExportProfilesServiceRequest{} + dest := NewOrigPtrExportProfilesServiceRequest() require.NoError(t, UnmarshalProtoOrigExportProfilesServiceRequest(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportProfilesServiceRequest(t *test goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectorprofiles.ExportProfilesServiceRequest{} + dest := NewOrigPtrExportProfilesServiceRequest() require.NoError(t, UnmarshalProtoOrigExportProfilesServiceRequest(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportProfilesServiceRequest(t *test func getEncodingTestValuesExportProfilesServiceRequest() map[string]*otlpcollectorprofiles.ExportProfilesServiceRequest { return map[string]*otlpcollectorprofiles.ExportProfilesServiceRequest{ - "empty": {}, + "empty": NewOrigPtrExportProfilesServiceRequest(), "fill_test": func() *otlpcollectorprofiles.ExportProfilesServiceRequest { - src := &otlpcollectorprofiles.ExportProfilesServiceRequest{} + src := NewOrigPtrExportProfilesServiceRequest() FillOrigTestExportProfilesServiceRequest(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exportprofilesserviceresponse_test.go b/pdata/internal/generated_wrapper_exportprofilesserviceresponse_test.go index 4fc3870fc1..8c40ae1190 100644 --- a/pdata/internal/generated_wrapper_exportprofilesserviceresponse_test.go +++ b/pdata/internal/generated_wrapper_exportprofilesserviceresponse_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportProfilesServiceResponse(t *testing.T) { - src := &otlpcollectorprofiles.ExportProfilesServiceResponse{} - dest := &otlpcollectorprofiles.ExportProfilesServiceResponse{} + src := NewOrigPtrExportProfilesServiceResponse() + dest := NewOrigPtrExportProfilesServiceResponse() CopyOrigExportProfilesServiceResponse(dest, src) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesServiceResponse(), dest) FillOrigTestExportProfilesServiceResponse(src) CopyOrigExportProfilesServiceResponse(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportProfilesServiceResponse(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportProfilesServiceResponseUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectorprofiles.ExportProfilesServiceResponse{} + dest := NewOrigPtrExportProfilesServiceResponse() UnmarshalJSONOrigExportProfilesServiceResponse(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesServiceResponse(), dest) } func TestMarshalAndUnmarshalJSONOrigExportProfilesServiceResponse(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportProfilesServiceResponse(t *testing.T) iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectorprofiles.ExportProfilesServiceResponse{} + dest := NewOrigPtrExportProfilesServiceResponse() UnmarshalJSONOrigExportProfilesServiceResponse(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportProfilesServiceResponse(t *testing.T) } func TestMarshalAndUnmarshalProtoOrigExportProfilesServiceResponseUnknown(t *testing.T) { - dest := &otlpcollectorprofiles.ExportProfilesServiceResponse{} + dest := NewOrigPtrExportProfilesServiceResponse() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportProfilesServiceResponse(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectorprofiles.ExportProfilesServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportProfilesServiceResponse(), dest) } func TestMarshalAndUnmarshalProtoOrigExportProfilesServiceResponse(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportProfilesServiceResponse(t *testing.T) gotSize := MarshalProtoOrigExportProfilesServiceResponse(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectorprofiles.ExportProfilesServiceResponse{} + dest := NewOrigPtrExportProfilesServiceResponse() require.NoError(t, UnmarshalProtoOrigExportProfilesServiceResponse(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportProfilesServiceResponse(t *tes goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectorprofiles.ExportProfilesServiceResponse{} + dest := NewOrigPtrExportProfilesServiceResponse() require.NoError(t, UnmarshalProtoOrigExportProfilesServiceResponse(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportProfilesServiceResponse(t *tes func getEncodingTestValuesExportProfilesServiceResponse() map[string]*otlpcollectorprofiles.ExportProfilesServiceResponse { return map[string]*otlpcollectorprofiles.ExportProfilesServiceResponse{ - "empty": {}, + "empty": NewOrigPtrExportProfilesServiceResponse(), "fill_test": func() *otlpcollectorprofiles.ExportProfilesServiceResponse { - src := &otlpcollectorprofiles.ExportProfilesServiceResponse{} + src := NewOrigPtrExportProfilesServiceResponse() FillOrigTestExportProfilesServiceResponse(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exporttracepartialsuccess_test.go b/pdata/internal/generated_wrapper_exporttracepartialsuccess_test.go index 8644c813a6..6dc3d08ac4 100644 --- a/pdata/internal/generated_wrapper_exporttracepartialsuccess_test.go +++ b/pdata/internal/generated_wrapper_exporttracepartialsuccess_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportTracePartialSuccess(t *testing.T) { - src := &otlpcollectortrace.ExportTracePartialSuccess{} - dest := &otlpcollectortrace.ExportTracePartialSuccess{} + src := NewOrigPtrExportTracePartialSuccess() + dest := NewOrigPtrExportTracePartialSuccess() CopyOrigExportTracePartialSuccess(dest, src) - assert.Equal(t, &otlpcollectortrace.ExportTracePartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportTracePartialSuccess(), dest) FillOrigTestExportTracePartialSuccess(src) CopyOrigExportTracePartialSuccess(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportTracePartialSuccess(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportTracePartialSuccessUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectortrace.ExportTracePartialSuccess{} + dest := NewOrigPtrExportTracePartialSuccess() UnmarshalJSONOrigExportTracePartialSuccess(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectortrace.ExportTracePartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportTracePartialSuccess(), dest) } func TestMarshalAndUnmarshalJSONOrigExportTracePartialSuccess(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportTracePartialSuccess(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectortrace.ExportTracePartialSuccess{} + dest := NewOrigPtrExportTracePartialSuccess() UnmarshalJSONOrigExportTracePartialSuccess(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportTracePartialSuccess(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportTracePartialSuccessUnknown(t *testing.T) { - dest := &otlpcollectortrace.ExportTracePartialSuccess{} + dest := NewOrigPtrExportTracePartialSuccess() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportTracePartialSuccess(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectortrace.ExportTracePartialSuccess{}, dest) + assert.Equal(t, NewOrigPtrExportTracePartialSuccess(), dest) } func TestMarshalAndUnmarshalProtoOrigExportTracePartialSuccess(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportTracePartialSuccess(t *testing.T) { gotSize := MarshalProtoOrigExportTracePartialSuccess(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectortrace.ExportTracePartialSuccess{} + dest := NewOrigPtrExportTracePartialSuccess() require.NoError(t, UnmarshalProtoOrigExportTracePartialSuccess(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportTracePartialSuccess(t *testing goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectortrace.ExportTracePartialSuccess{} + dest := NewOrigPtrExportTracePartialSuccess() require.NoError(t, UnmarshalProtoOrigExportTracePartialSuccess(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportTracePartialSuccess(t *testing func getEncodingTestValuesExportTracePartialSuccess() map[string]*otlpcollectortrace.ExportTracePartialSuccess { return map[string]*otlpcollectortrace.ExportTracePartialSuccess{ - "empty": {}, + "empty": NewOrigPtrExportTracePartialSuccess(), "fill_test": func() *otlpcollectortrace.ExportTracePartialSuccess { - src := &otlpcollectortrace.ExportTracePartialSuccess{} + src := NewOrigPtrExportTracePartialSuccess() FillOrigTestExportTracePartialSuccess(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exporttraceservicerequest.go b/pdata/internal/generated_wrapper_exporttraceservicerequest.go index 8f71d70315..35ff5eb57b 100644 --- a/pdata/internal/generated_wrapper_exporttraceservicerequest.go +++ b/pdata/internal/generated_wrapper_exporttraceservicerequest.go @@ -32,9 +32,9 @@ func NewTraces(orig *otlpcollectortrace.ExportTraceServiceRequest, state *State) } func GenerateTestTraces() Traces { - orig := otlpcollectortrace.ExportTraceServiceRequest{} - FillOrigTestExportTraceServiceRequest(&orig) - return NewTraces(&orig, NewState()) + orig := NewOrigPtrExportTraceServiceRequest() + FillOrigTestExportTraceServiceRequest(orig) + return NewTraces(orig, NewState()) } func NewOrigExportTraceServiceRequest() otlpcollectortrace.ExportTraceServiceRequest { diff --git a/pdata/internal/generated_wrapper_exporttraceservicerequest_test.go b/pdata/internal/generated_wrapper_exporttraceservicerequest_test.go index d6e08c6f5e..ae1d12815a 100644 --- a/pdata/internal/generated_wrapper_exporttraceservicerequest_test.go +++ b/pdata/internal/generated_wrapper_exporttraceservicerequest_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportTraceServiceRequest(t *testing.T) { - src := &otlpcollectortrace.ExportTraceServiceRequest{} - dest := &otlpcollectortrace.ExportTraceServiceRequest{} + src := NewOrigPtrExportTraceServiceRequest() + dest := NewOrigPtrExportTraceServiceRequest() CopyOrigExportTraceServiceRequest(dest, src) - assert.Equal(t, &otlpcollectortrace.ExportTraceServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportTraceServiceRequest(), dest) FillOrigTestExportTraceServiceRequest(src) CopyOrigExportTraceServiceRequest(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportTraceServiceRequest(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportTraceServiceRequestUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectortrace.ExportTraceServiceRequest{} + dest := NewOrigPtrExportTraceServiceRequest() UnmarshalJSONOrigExportTraceServiceRequest(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectortrace.ExportTraceServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportTraceServiceRequest(), dest) } func TestMarshalAndUnmarshalJSONOrigExportTraceServiceRequest(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportTraceServiceRequest(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectortrace.ExportTraceServiceRequest{} + dest := NewOrigPtrExportTraceServiceRequest() UnmarshalJSONOrigExportTraceServiceRequest(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportTraceServiceRequest(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportTraceServiceRequestUnknown(t *testing.T) { - dest := &otlpcollectortrace.ExportTraceServiceRequest{} + dest := NewOrigPtrExportTraceServiceRequest() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportTraceServiceRequest(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectortrace.ExportTraceServiceRequest{}, dest) + assert.Equal(t, NewOrigPtrExportTraceServiceRequest(), dest) } func TestMarshalAndUnmarshalProtoOrigExportTraceServiceRequest(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportTraceServiceRequest(t *testing.T) { gotSize := MarshalProtoOrigExportTraceServiceRequest(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectortrace.ExportTraceServiceRequest{} + dest := NewOrigPtrExportTraceServiceRequest() require.NoError(t, UnmarshalProtoOrigExportTraceServiceRequest(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportTraceServiceRequest(t *testing goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectortrace.ExportTraceServiceRequest{} + dest := NewOrigPtrExportTraceServiceRequest() require.NoError(t, UnmarshalProtoOrigExportTraceServiceRequest(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportTraceServiceRequest(t *testing func getEncodingTestValuesExportTraceServiceRequest() map[string]*otlpcollectortrace.ExportTraceServiceRequest { return map[string]*otlpcollectortrace.ExportTraceServiceRequest{ - "empty": {}, + "empty": NewOrigPtrExportTraceServiceRequest(), "fill_test": func() *otlpcollectortrace.ExportTraceServiceRequest { - src := &otlpcollectortrace.ExportTraceServiceRequest{} + src := NewOrigPtrExportTraceServiceRequest() FillOrigTestExportTraceServiceRequest(src) return src }(), diff --git a/pdata/internal/generated_wrapper_exporttraceserviceresponse_test.go b/pdata/internal/generated_wrapper_exporttraceserviceresponse_test.go index 2bfdd76808..d7d06b6f50 100644 --- a/pdata/internal/generated_wrapper_exporttraceserviceresponse_test.go +++ b/pdata/internal/generated_wrapper_exporttraceserviceresponse_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigExportTraceServiceResponse(t *testing.T) { - src := &otlpcollectortrace.ExportTraceServiceResponse{} - dest := &otlpcollectortrace.ExportTraceServiceResponse{} + src := NewOrigPtrExportTraceServiceResponse() + dest := NewOrigPtrExportTraceServiceResponse() CopyOrigExportTraceServiceResponse(dest, src) - assert.Equal(t, &otlpcollectortrace.ExportTraceServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportTraceServiceResponse(), dest) FillOrigTestExportTraceServiceResponse(src) CopyOrigExportTraceServiceResponse(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigExportTraceServiceResponse(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigExportTraceServiceResponseUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcollectortrace.ExportTraceServiceResponse{} + dest := NewOrigPtrExportTraceServiceResponse() UnmarshalJSONOrigExportTraceServiceResponse(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcollectortrace.ExportTraceServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportTraceServiceResponse(), dest) } func TestMarshalAndUnmarshalJSONOrigExportTraceServiceResponse(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigExportTraceServiceResponse(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcollectortrace.ExportTraceServiceResponse{} + dest := NewOrigPtrExportTraceServiceResponse() UnmarshalJSONOrigExportTraceServiceResponse(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigExportTraceServiceResponse(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigExportTraceServiceResponseUnknown(t *testing.T) { - dest := &otlpcollectortrace.ExportTraceServiceResponse{} + dest := NewOrigPtrExportTraceServiceResponse() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigExportTraceServiceResponse(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcollectortrace.ExportTraceServiceResponse{}, dest) + assert.Equal(t, NewOrigPtrExportTraceServiceResponse(), dest) } func TestMarshalAndUnmarshalProtoOrigExportTraceServiceResponse(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigExportTraceServiceResponse(t *testing.T) { gotSize := MarshalProtoOrigExportTraceServiceResponse(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcollectortrace.ExportTraceServiceResponse{} + dest := NewOrigPtrExportTraceServiceResponse() require.NoError(t, UnmarshalProtoOrigExportTraceServiceResponse(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportTraceServiceResponse(t *testin goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcollectortrace.ExportTraceServiceResponse{} + dest := NewOrigPtrExportTraceServiceResponse() require.NoError(t, UnmarshalProtoOrigExportTraceServiceResponse(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufExportTraceServiceResponse(t *testin func getEncodingTestValuesExportTraceServiceResponse() map[string]*otlpcollectortrace.ExportTraceServiceResponse { return map[string]*otlpcollectortrace.ExportTraceServiceResponse{ - "empty": {}, + "empty": NewOrigPtrExportTraceServiceResponse(), "fill_test": func() *otlpcollectortrace.ExportTraceServiceResponse { - src := &otlpcollectortrace.ExportTraceServiceResponse{} + src := NewOrigPtrExportTraceServiceResponse() FillOrigTestExportTraceServiceResponse(src) return src }(), diff --git a/pdata/internal/generated_wrapper_function_test.go b/pdata/internal/generated_wrapper_function_test.go index 279ccda960..bdb8d8901d 100644 --- a/pdata/internal/generated_wrapper_function_test.go +++ b/pdata/internal/generated_wrapper_function_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigFunction(t *testing.T) { - src := &otlpprofiles.Function{} - dest := &otlpprofiles.Function{} + src := NewOrigPtrFunction() + dest := NewOrigPtrFunction() CopyOrigFunction(dest, src) - assert.Equal(t, &otlpprofiles.Function{}, dest) + assert.Equal(t, NewOrigPtrFunction(), dest) FillOrigTestFunction(src) CopyOrigFunction(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigFunction(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigFunctionUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Function{} + dest := NewOrigPtrFunction() UnmarshalJSONOrigFunction(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.Function{}, dest) + assert.Equal(t, NewOrigPtrFunction(), dest) } func TestMarshalAndUnmarshalJSONOrigFunction(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigFunction(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Function{} + dest := NewOrigPtrFunction() UnmarshalJSONOrigFunction(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigFunction(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigFunctionUnknown(t *testing.T) { - dest := &otlpprofiles.Function{} + dest := NewOrigPtrFunction() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigFunction(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.Function{}, dest) + assert.Equal(t, NewOrigPtrFunction(), dest) } func TestMarshalAndUnmarshalProtoOrigFunction(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigFunction(t *testing.T) { gotSize := MarshalProtoOrigFunction(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.Function{} + dest := NewOrigPtrFunction() require.NoError(t, UnmarshalProtoOrigFunction(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufFunction(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.Function{} + dest := NewOrigPtrFunction() require.NoError(t, UnmarshalProtoOrigFunction(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufFunction(t *testing.T) { func getEncodingTestValuesFunction() map[string]*otlpprofiles.Function { return map[string]*otlpprofiles.Function{ - "empty": {}, + "empty": NewOrigPtrFunction(), "fill_test": func() *otlpprofiles.Function { - src := &otlpprofiles.Function{} + src := NewOrigPtrFunction() FillOrigTestFunction(src) return src }(), diff --git a/pdata/internal/generated_wrapper_gauge_test.go b/pdata/internal/generated_wrapper_gauge_test.go index f7d8e654d9..44f0e2c953 100644 --- a/pdata/internal/generated_wrapper_gauge_test.go +++ b/pdata/internal/generated_wrapper_gauge_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigGauge(t *testing.T) { - src := &otlpmetrics.Gauge{} - dest := &otlpmetrics.Gauge{} + src := NewOrigPtrGauge() + dest := NewOrigPtrGauge() CopyOrigGauge(dest, src) - assert.Equal(t, &otlpmetrics.Gauge{}, dest) + assert.Equal(t, NewOrigPtrGauge(), dest) FillOrigTestGauge(src) CopyOrigGauge(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigGauge(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigGaugeUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Gauge{} + dest := NewOrigPtrGauge() UnmarshalJSONOrigGauge(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.Gauge{}, dest) + assert.Equal(t, NewOrigPtrGauge(), dest) } func TestMarshalAndUnmarshalJSONOrigGauge(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigGauge(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Gauge{} + dest := NewOrigPtrGauge() UnmarshalJSONOrigGauge(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigGauge(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigGaugeUnknown(t *testing.T) { - dest := &otlpmetrics.Gauge{} + dest := NewOrigPtrGauge() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigGauge(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.Gauge{}, dest) + assert.Equal(t, NewOrigPtrGauge(), dest) } func TestMarshalAndUnmarshalProtoOrigGauge(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigGauge(t *testing.T) { gotSize := MarshalProtoOrigGauge(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.Gauge{} + dest := NewOrigPtrGauge() require.NoError(t, UnmarshalProtoOrigGauge(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufGauge(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.Gauge{} + dest := NewOrigPtrGauge() require.NoError(t, UnmarshalProtoOrigGauge(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufGauge(t *testing.T) { func getEncodingTestValuesGauge() map[string]*otlpmetrics.Gauge { return map[string]*otlpmetrics.Gauge{ - "empty": {}, + "empty": NewOrigPtrGauge(), "fill_test": func() *otlpmetrics.Gauge { - src := &otlpmetrics.Gauge{} + src := NewOrigPtrGauge() FillOrigTestGauge(src) return src }(), diff --git a/pdata/internal/generated_wrapper_histogram_test.go b/pdata/internal/generated_wrapper_histogram_test.go index 44256bd082..c653552133 100644 --- a/pdata/internal/generated_wrapper_histogram_test.go +++ b/pdata/internal/generated_wrapper_histogram_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigHistogram(t *testing.T) { - src := &otlpmetrics.Histogram{} - dest := &otlpmetrics.Histogram{} + src := NewOrigPtrHistogram() + dest := NewOrigPtrHistogram() CopyOrigHistogram(dest, src) - assert.Equal(t, &otlpmetrics.Histogram{}, dest) + assert.Equal(t, NewOrigPtrHistogram(), dest) FillOrigTestHistogram(src) CopyOrigHistogram(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigHistogram(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigHistogramUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Histogram{} + dest := NewOrigPtrHistogram() UnmarshalJSONOrigHistogram(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.Histogram{}, dest) + assert.Equal(t, NewOrigPtrHistogram(), dest) } func TestMarshalAndUnmarshalJSONOrigHistogram(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigHistogram(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Histogram{} + dest := NewOrigPtrHistogram() UnmarshalJSONOrigHistogram(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigHistogram(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigHistogramUnknown(t *testing.T) { - dest := &otlpmetrics.Histogram{} + dest := NewOrigPtrHistogram() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigHistogram(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.Histogram{}, dest) + assert.Equal(t, NewOrigPtrHistogram(), dest) } func TestMarshalAndUnmarshalProtoOrigHistogram(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigHistogram(t *testing.T) { gotSize := MarshalProtoOrigHistogram(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.Histogram{} + dest := NewOrigPtrHistogram() require.NoError(t, UnmarshalProtoOrigHistogram(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufHistogram(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.Histogram{} + dest := NewOrigPtrHistogram() require.NoError(t, UnmarshalProtoOrigHistogram(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufHistogram(t *testing.T) { func getEncodingTestValuesHistogram() map[string]*otlpmetrics.Histogram { return map[string]*otlpmetrics.Histogram{ - "empty": {}, + "empty": NewOrigPtrHistogram(), "fill_test": func() *otlpmetrics.Histogram { - src := &otlpmetrics.Histogram{} + src := NewOrigPtrHistogram() FillOrigTestHistogram(src) return src }(), diff --git a/pdata/internal/generated_wrapper_histogramdatapoint_test.go b/pdata/internal/generated_wrapper_histogramdatapoint_test.go index 6c37a07454..52fee3d4d9 100644 --- a/pdata/internal/generated_wrapper_histogramdatapoint_test.go +++ b/pdata/internal/generated_wrapper_histogramdatapoint_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigHistogramDataPoint(t *testing.T) { - src := &otlpmetrics.HistogramDataPoint{} - dest := &otlpmetrics.HistogramDataPoint{} + src := NewOrigPtrHistogramDataPoint() + dest := NewOrigPtrHistogramDataPoint() CopyOrigHistogramDataPoint(dest, src) - assert.Equal(t, &otlpmetrics.HistogramDataPoint{}, dest) + assert.Equal(t, NewOrigPtrHistogramDataPoint(), dest) FillOrigTestHistogramDataPoint(src) CopyOrigHistogramDataPoint(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigHistogramDataPoint(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigHistogramDataPointUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.HistogramDataPoint{} + dest := NewOrigPtrHistogramDataPoint() UnmarshalJSONOrigHistogramDataPoint(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.HistogramDataPoint{}, dest) + assert.Equal(t, NewOrigPtrHistogramDataPoint(), dest) } func TestMarshalAndUnmarshalJSONOrigHistogramDataPoint(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigHistogramDataPoint(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.HistogramDataPoint{} + dest := NewOrigPtrHistogramDataPoint() UnmarshalJSONOrigHistogramDataPoint(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigHistogramDataPoint(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigHistogramDataPointUnknown(t *testing.T) { - dest := &otlpmetrics.HistogramDataPoint{} + dest := NewOrigPtrHistogramDataPoint() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigHistogramDataPoint(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.HistogramDataPoint{}, dest) + assert.Equal(t, NewOrigPtrHistogramDataPoint(), dest) } func TestMarshalAndUnmarshalProtoOrigHistogramDataPoint(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigHistogramDataPoint(t *testing.T) { gotSize := MarshalProtoOrigHistogramDataPoint(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.HistogramDataPoint{} + dest := NewOrigPtrHistogramDataPoint() require.NoError(t, UnmarshalProtoOrigHistogramDataPoint(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufHistogramDataPoint(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.HistogramDataPoint{} + dest := NewOrigPtrHistogramDataPoint() require.NoError(t, UnmarshalProtoOrigHistogramDataPoint(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufHistogramDataPoint(t *testing.T) { func getEncodingTestValuesHistogramDataPoint() map[string]*otlpmetrics.HistogramDataPoint { return map[string]*otlpmetrics.HistogramDataPoint{ - "empty": {}, + "empty": NewOrigPtrHistogramDataPoint(), "fill_test": func() *otlpmetrics.HistogramDataPoint { - src := &otlpmetrics.HistogramDataPoint{} + src := NewOrigPtrHistogramDataPoint() FillOrigTestHistogramDataPoint(src) return src }(), diff --git a/pdata/internal/generated_wrapper_instrumentationscope.go b/pdata/internal/generated_wrapper_instrumentationscope.go index 0e5ec07801..92fed83f29 100644 --- a/pdata/internal/generated_wrapper_instrumentationscope.go +++ b/pdata/internal/generated_wrapper_instrumentationscope.go @@ -32,9 +32,9 @@ func NewInstrumentationScope(orig *otlpcommon.InstrumentationScope, state *State } func GenerateTestInstrumentationScope() InstrumentationScope { - orig := otlpcommon.InstrumentationScope{} - FillOrigTestInstrumentationScope(&orig) - return NewInstrumentationScope(&orig, NewState()) + orig := NewOrigPtrInstrumentationScope() + FillOrigTestInstrumentationScope(orig) + return NewInstrumentationScope(orig, NewState()) } func NewOrigInstrumentationScope() otlpcommon.InstrumentationScope { diff --git a/pdata/internal/generated_wrapper_instrumentationscope_test.go b/pdata/internal/generated_wrapper_instrumentationscope_test.go index bb400b26c6..a4e6958dc0 100644 --- a/pdata/internal/generated_wrapper_instrumentationscope_test.go +++ b/pdata/internal/generated_wrapper_instrumentationscope_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigInstrumentationScope(t *testing.T) { - src := &otlpcommon.InstrumentationScope{} - dest := &otlpcommon.InstrumentationScope{} + src := NewOrigPtrInstrumentationScope() + dest := NewOrigPtrInstrumentationScope() CopyOrigInstrumentationScope(dest, src) - assert.Equal(t, &otlpcommon.InstrumentationScope{}, dest) + assert.Equal(t, NewOrigPtrInstrumentationScope(), dest) FillOrigTestInstrumentationScope(src) CopyOrigInstrumentationScope(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigInstrumentationScope(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigInstrumentationScopeUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcommon.InstrumentationScope{} + dest := NewOrigPtrInstrumentationScope() UnmarshalJSONOrigInstrumentationScope(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcommon.InstrumentationScope{}, dest) + assert.Equal(t, NewOrigPtrInstrumentationScope(), dest) } func TestMarshalAndUnmarshalJSONOrigInstrumentationScope(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigInstrumentationScope(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcommon.InstrumentationScope{} + dest := NewOrigPtrInstrumentationScope() UnmarshalJSONOrigInstrumentationScope(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigInstrumentationScope(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigInstrumentationScopeUnknown(t *testing.T) { - dest := &otlpcommon.InstrumentationScope{} + dest := NewOrigPtrInstrumentationScope() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigInstrumentationScope(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcommon.InstrumentationScope{}, dest) + assert.Equal(t, NewOrigPtrInstrumentationScope(), dest) } func TestMarshalAndUnmarshalProtoOrigInstrumentationScope(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigInstrumentationScope(t *testing.T) { gotSize := MarshalProtoOrigInstrumentationScope(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcommon.InstrumentationScope{} + dest := NewOrigPtrInstrumentationScope() require.NoError(t, UnmarshalProtoOrigInstrumentationScope(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufInstrumentationScope(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcommon.InstrumentationScope{} + dest := NewOrigPtrInstrumentationScope() require.NoError(t, UnmarshalProtoOrigInstrumentationScope(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufInstrumentationScope(t *testing.T) { func getEncodingTestValuesInstrumentationScope() map[string]*otlpcommon.InstrumentationScope { return map[string]*otlpcommon.InstrumentationScope{ - "empty": {}, + "empty": NewOrigPtrInstrumentationScope(), "fill_test": func() *otlpcommon.InstrumentationScope { - src := &otlpcommon.InstrumentationScope{} + src := NewOrigPtrInstrumentationScope() FillOrigTestInstrumentationScope(src) return src }(), diff --git a/pdata/internal/generated_wrapper_keyvalue_test.go b/pdata/internal/generated_wrapper_keyvalue_test.go index 8a8465a955..cc26195151 100644 --- a/pdata/internal/generated_wrapper_keyvalue_test.go +++ b/pdata/internal/generated_wrapper_keyvalue_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigKeyValue(t *testing.T) { - src := &otlpcommon.KeyValue{} - dest := &otlpcommon.KeyValue{} + src := NewOrigPtrKeyValue() + dest := NewOrigPtrKeyValue() CopyOrigKeyValue(dest, src) - assert.Equal(t, &otlpcommon.KeyValue{}, dest) + assert.Equal(t, NewOrigPtrKeyValue(), dest) FillOrigTestKeyValue(src) CopyOrigKeyValue(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigKeyValue(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigKeyValueUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpcommon.KeyValue{} + dest := NewOrigPtrKeyValue() UnmarshalJSONOrigKeyValue(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpcommon.KeyValue{}, dest) + assert.Equal(t, NewOrigPtrKeyValue(), dest) } func TestMarshalAndUnmarshalJSONOrigKeyValue(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigKeyValue(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpcommon.KeyValue{} + dest := NewOrigPtrKeyValue() UnmarshalJSONOrigKeyValue(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigKeyValue(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigKeyValueUnknown(t *testing.T) { - dest := &otlpcommon.KeyValue{} + dest := NewOrigPtrKeyValue() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigKeyValue(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpcommon.KeyValue{}, dest) + assert.Equal(t, NewOrigPtrKeyValue(), dest) } func TestMarshalAndUnmarshalProtoOrigKeyValue(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigKeyValue(t *testing.T) { gotSize := MarshalProtoOrigKeyValue(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpcommon.KeyValue{} + dest := NewOrigPtrKeyValue() require.NoError(t, UnmarshalProtoOrigKeyValue(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufKeyValue(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpcommon.KeyValue{} + dest := NewOrigPtrKeyValue() require.NoError(t, UnmarshalProtoOrigKeyValue(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufKeyValue(t *testing.T) { func getEncodingTestValuesKeyValue() map[string]*otlpcommon.KeyValue { return map[string]*otlpcommon.KeyValue{ - "empty": {}, + "empty": NewOrigPtrKeyValue(), "fill_test": func() *otlpcommon.KeyValue { - src := &otlpcommon.KeyValue{} + src := NewOrigPtrKeyValue() FillOrigTestKeyValue(src) return src }(), diff --git a/pdata/internal/generated_wrapper_line_test.go b/pdata/internal/generated_wrapper_line_test.go index b92c34fc3f..c912dc4cee 100644 --- a/pdata/internal/generated_wrapper_line_test.go +++ b/pdata/internal/generated_wrapper_line_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigLine(t *testing.T) { - src := &otlpprofiles.Line{} - dest := &otlpprofiles.Line{} + src := NewOrigPtrLine() + dest := NewOrigPtrLine() CopyOrigLine(dest, src) - assert.Equal(t, &otlpprofiles.Line{}, dest) + assert.Equal(t, NewOrigPtrLine(), dest) FillOrigTestLine(src) CopyOrigLine(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigLine(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigLineUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Line{} + dest := NewOrigPtrLine() UnmarshalJSONOrigLine(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.Line{}, dest) + assert.Equal(t, NewOrigPtrLine(), dest) } func TestMarshalAndUnmarshalJSONOrigLine(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigLine(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Line{} + dest := NewOrigPtrLine() UnmarshalJSONOrigLine(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigLine(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigLineUnknown(t *testing.T) { - dest := &otlpprofiles.Line{} + dest := NewOrigPtrLine() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigLine(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.Line{}, dest) + assert.Equal(t, NewOrigPtrLine(), dest) } func TestMarshalAndUnmarshalProtoOrigLine(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigLine(t *testing.T) { gotSize := MarshalProtoOrigLine(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.Line{} + dest := NewOrigPtrLine() require.NoError(t, UnmarshalProtoOrigLine(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufLine(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.Line{} + dest := NewOrigPtrLine() require.NoError(t, UnmarshalProtoOrigLine(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufLine(t *testing.T) { func getEncodingTestValuesLine() map[string]*otlpprofiles.Line { return map[string]*otlpprofiles.Line{ - "empty": {}, + "empty": NewOrigPtrLine(), "fill_test": func() *otlpprofiles.Line { - src := &otlpprofiles.Line{} + src := NewOrigPtrLine() FillOrigTestLine(src) return src }(), diff --git a/pdata/internal/generated_wrapper_link_test.go b/pdata/internal/generated_wrapper_link_test.go index 446f98c004..8728f65c01 100644 --- a/pdata/internal/generated_wrapper_link_test.go +++ b/pdata/internal/generated_wrapper_link_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigLink(t *testing.T) { - src := &otlpprofiles.Link{} - dest := &otlpprofiles.Link{} + src := NewOrigPtrLink() + dest := NewOrigPtrLink() CopyOrigLink(dest, src) - assert.Equal(t, &otlpprofiles.Link{}, dest) + assert.Equal(t, NewOrigPtrLink(), dest) FillOrigTestLink(src) CopyOrigLink(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigLink(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigLinkUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Link{} + dest := NewOrigPtrLink() UnmarshalJSONOrigLink(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.Link{}, dest) + assert.Equal(t, NewOrigPtrLink(), dest) } func TestMarshalAndUnmarshalJSONOrigLink(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigLink(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Link{} + dest := NewOrigPtrLink() UnmarshalJSONOrigLink(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigLink(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigLinkUnknown(t *testing.T) { - dest := &otlpprofiles.Link{} + dest := NewOrigPtrLink() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigLink(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.Link{}, dest) + assert.Equal(t, NewOrigPtrLink(), dest) } func TestMarshalAndUnmarshalProtoOrigLink(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigLink(t *testing.T) { gotSize := MarshalProtoOrigLink(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.Link{} + dest := NewOrigPtrLink() require.NoError(t, UnmarshalProtoOrigLink(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufLink(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.Link{} + dest := NewOrigPtrLink() require.NoError(t, UnmarshalProtoOrigLink(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufLink(t *testing.T) { func getEncodingTestValuesLink() map[string]*otlpprofiles.Link { return map[string]*otlpprofiles.Link{ - "empty": {}, + "empty": NewOrigPtrLink(), "fill_test": func() *otlpprofiles.Link { - src := &otlpprofiles.Link{} + src := NewOrigPtrLink() FillOrigTestLink(src) return src }(), diff --git a/pdata/internal/generated_wrapper_location_test.go b/pdata/internal/generated_wrapper_location_test.go index 803c1a6676..89f1bcb16d 100644 --- a/pdata/internal/generated_wrapper_location_test.go +++ b/pdata/internal/generated_wrapper_location_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigLocation(t *testing.T) { - src := &otlpprofiles.Location{} - dest := &otlpprofiles.Location{} + src := NewOrigPtrLocation() + dest := NewOrigPtrLocation() CopyOrigLocation(dest, src) - assert.Equal(t, &otlpprofiles.Location{}, dest) + assert.Equal(t, NewOrigPtrLocation(), dest) FillOrigTestLocation(src) CopyOrigLocation(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigLocation(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigLocationUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Location{} + dest := NewOrigPtrLocation() UnmarshalJSONOrigLocation(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.Location{}, dest) + assert.Equal(t, NewOrigPtrLocation(), dest) } func TestMarshalAndUnmarshalJSONOrigLocation(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigLocation(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Location{} + dest := NewOrigPtrLocation() UnmarshalJSONOrigLocation(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigLocation(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigLocationUnknown(t *testing.T) { - dest := &otlpprofiles.Location{} + dest := NewOrigPtrLocation() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigLocation(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.Location{}, dest) + assert.Equal(t, NewOrigPtrLocation(), dest) } func TestMarshalAndUnmarshalProtoOrigLocation(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigLocation(t *testing.T) { gotSize := MarshalProtoOrigLocation(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.Location{} + dest := NewOrigPtrLocation() require.NoError(t, UnmarshalProtoOrigLocation(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufLocation(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.Location{} + dest := NewOrigPtrLocation() require.NoError(t, UnmarshalProtoOrigLocation(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufLocation(t *testing.T) { func getEncodingTestValuesLocation() map[string]*otlpprofiles.Location { return map[string]*otlpprofiles.Location{ - "empty": {}, + "empty": NewOrigPtrLocation(), "fill_test": func() *otlpprofiles.Location { - src := &otlpprofiles.Location{} + src := NewOrigPtrLocation() FillOrigTestLocation(src) return src }(), diff --git a/pdata/internal/generated_wrapper_logrecord_test.go b/pdata/internal/generated_wrapper_logrecord_test.go index 33f000a3ae..bc16e0c507 100644 --- a/pdata/internal/generated_wrapper_logrecord_test.go +++ b/pdata/internal/generated_wrapper_logrecord_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigLogRecord(t *testing.T) { - src := &otlplogs.LogRecord{} - dest := &otlplogs.LogRecord{} + src := NewOrigPtrLogRecord() + dest := NewOrigPtrLogRecord() CopyOrigLogRecord(dest, src) - assert.Equal(t, &otlplogs.LogRecord{}, dest) + assert.Equal(t, NewOrigPtrLogRecord(), dest) FillOrigTestLogRecord(src) CopyOrigLogRecord(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigLogRecord(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigLogRecordUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlplogs.LogRecord{} + dest := NewOrigPtrLogRecord() UnmarshalJSONOrigLogRecord(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlplogs.LogRecord{}, dest) + assert.Equal(t, NewOrigPtrLogRecord(), dest) } func TestMarshalAndUnmarshalJSONOrigLogRecord(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigLogRecord(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlplogs.LogRecord{} + dest := NewOrigPtrLogRecord() UnmarshalJSONOrigLogRecord(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigLogRecord(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigLogRecordUnknown(t *testing.T) { - dest := &otlplogs.LogRecord{} + dest := NewOrigPtrLogRecord() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigLogRecord(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlplogs.LogRecord{}, dest) + assert.Equal(t, NewOrigPtrLogRecord(), dest) } func TestMarshalAndUnmarshalProtoOrigLogRecord(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigLogRecord(t *testing.T) { gotSize := MarshalProtoOrigLogRecord(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlplogs.LogRecord{} + dest := NewOrigPtrLogRecord() require.NoError(t, UnmarshalProtoOrigLogRecord(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufLogRecord(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlplogs.LogRecord{} + dest := NewOrigPtrLogRecord() require.NoError(t, UnmarshalProtoOrigLogRecord(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufLogRecord(t *testing.T) { func getEncodingTestValuesLogRecord() map[string]*otlplogs.LogRecord { return map[string]*otlplogs.LogRecord{ - "empty": {}, + "empty": NewOrigPtrLogRecord(), "fill_test": func() *otlplogs.LogRecord { - src := &otlplogs.LogRecord{} + src := NewOrigPtrLogRecord() FillOrigTestLogRecord(src) return src }(), diff --git a/pdata/internal/generated_wrapper_mapping_test.go b/pdata/internal/generated_wrapper_mapping_test.go index db550b85d4..050a687120 100644 --- a/pdata/internal/generated_wrapper_mapping_test.go +++ b/pdata/internal/generated_wrapper_mapping_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigMapping(t *testing.T) { - src := &otlpprofiles.Mapping{} - dest := &otlpprofiles.Mapping{} + src := NewOrigPtrMapping() + dest := NewOrigPtrMapping() CopyOrigMapping(dest, src) - assert.Equal(t, &otlpprofiles.Mapping{}, dest) + assert.Equal(t, NewOrigPtrMapping(), dest) FillOrigTestMapping(src) CopyOrigMapping(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigMapping(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigMappingUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Mapping{} + dest := NewOrigPtrMapping() UnmarshalJSONOrigMapping(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.Mapping{}, dest) + assert.Equal(t, NewOrigPtrMapping(), dest) } func TestMarshalAndUnmarshalJSONOrigMapping(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigMapping(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Mapping{} + dest := NewOrigPtrMapping() UnmarshalJSONOrigMapping(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigMapping(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigMappingUnknown(t *testing.T) { - dest := &otlpprofiles.Mapping{} + dest := NewOrigPtrMapping() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigMapping(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.Mapping{}, dest) + assert.Equal(t, NewOrigPtrMapping(), dest) } func TestMarshalAndUnmarshalProtoOrigMapping(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigMapping(t *testing.T) { gotSize := MarshalProtoOrigMapping(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.Mapping{} + dest := NewOrigPtrMapping() require.NoError(t, UnmarshalProtoOrigMapping(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufMapping(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.Mapping{} + dest := NewOrigPtrMapping() require.NoError(t, UnmarshalProtoOrigMapping(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufMapping(t *testing.T) { func getEncodingTestValuesMapping() map[string]*otlpprofiles.Mapping { return map[string]*otlpprofiles.Mapping{ - "empty": {}, + "empty": NewOrigPtrMapping(), "fill_test": func() *otlpprofiles.Mapping { - src := &otlpprofiles.Mapping{} + src := NewOrigPtrMapping() FillOrigTestMapping(src) return src }(), diff --git a/pdata/internal/generated_wrapper_metric_test.go b/pdata/internal/generated_wrapper_metric_test.go index ab40c455b0..0881efbc23 100644 --- a/pdata/internal/generated_wrapper_metric_test.go +++ b/pdata/internal/generated_wrapper_metric_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigMetric(t *testing.T) { - src := &otlpmetrics.Metric{} - dest := &otlpmetrics.Metric{} + src := NewOrigPtrMetric() + dest := NewOrigPtrMetric() CopyOrigMetric(dest, src) - assert.Equal(t, &otlpmetrics.Metric{}, dest) + assert.Equal(t, NewOrigPtrMetric(), dest) FillOrigTestMetric(src) CopyOrigMetric(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigMetric(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigMetricUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Metric{} + dest := NewOrigPtrMetric() UnmarshalJSONOrigMetric(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.Metric{}, dest) + assert.Equal(t, NewOrigPtrMetric(), dest) } func TestMarshalAndUnmarshalJSONOrigMetric(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigMetric(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Metric{} + dest := NewOrigPtrMetric() UnmarshalJSONOrigMetric(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigMetric(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigMetricUnknown(t *testing.T) { - dest := &otlpmetrics.Metric{} + dest := NewOrigPtrMetric() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigMetric(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.Metric{}, dest) + assert.Equal(t, NewOrigPtrMetric(), dest) } func TestMarshalAndUnmarshalProtoOrigMetric(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigMetric(t *testing.T) { gotSize := MarshalProtoOrigMetric(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.Metric{} + dest := NewOrigPtrMetric() require.NoError(t, UnmarshalProtoOrigMetric(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufMetric(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.Metric{} + dest := NewOrigPtrMetric() require.NoError(t, UnmarshalProtoOrigMetric(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufMetric(t *testing.T) { func getEncodingTestValuesMetric() map[string]*otlpmetrics.Metric { return map[string]*otlpmetrics.Metric{ - "empty": {}, + "empty": NewOrigPtrMetric(), "fill_test": func() *otlpmetrics.Metric { - src := &otlpmetrics.Metric{} + src := NewOrigPtrMetric() FillOrigTestMetric(src) return src }(), diff --git a/pdata/internal/generated_wrapper_numberdatapoint_test.go b/pdata/internal/generated_wrapper_numberdatapoint_test.go index 8ec153703f..372dcd22c6 100644 --- a/pdata/internal/generated_wrapper_numberdatapoint_test.go +++ b/pdata/internal/generated_wrapper_numberdatapoint_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigNumberDataPoint(t *testing.T) { - src := &otlpmetrics.NumberDataPoint{} - dest := &otlpmetrics.NumberDataPoint{} + src := NewOrigPtrNumberDataPoint() + dest := NewOrigPtrNumberDataPoint() CopyOrigNumberDataPoint(dest, src) - assert.Equal(t, &otlpmetrics.NumberDataPoint{}, dest) + assert.Equal(t, NewOrigPtrNumberDataPoint(), dest) FillOrigTestNumberDataPoint(src) CopyOrigNumberDataPoint(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigNumberDataPoint(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigNumberDataPointUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.NumberDataPoint{} + dest := NewOrigPtrNumberDataPoint() UnmarshalJSONOrigNumberDataPoint(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.NumberDataPoint{}, dest) + assert.Equal(t, NewOrigPtrNumberDataPoint(), dest) } func TestMarshalAndUnmarshalJSONOrigNumberDataPoint(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigNumberDataPoint(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.NumberDataPoint{} + dest := NewOrigPtrNumberDataPoint() UnmarshalJSONOrigNumberDataPoint(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigNumberDataPoint(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigNumberDataPointUnknown(t *testing.T) { - dest := &otlpmetrics.NumberDataPoint{} + dest := NewOrigPtrNumberDataPoint() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigNumberDataPoint(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.NumberDataPoint{}, dest) + assert.Equal(t, NewOrigPtrNumberDataPoint(), dest) } func TestMarshalAndUnmarshalProtoOrigNumberDataPoint(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigNumberDataPoint(t *testing.T) { gotSize := MarshalProtoOrigNumberDataPoint(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.NumberDataPoint{} + dest := NewOrigPtrNumberDataPoint() require.NoError(t, UnmarshalProtoOrigNumberDataPoint(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufNumberDataPoint(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.NumberDataPoint{} + dest := NewOrigPtrNumberDataPoint() require.NoError(t, UnmarshalProtoOrigNumberDataPoint(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufNumberDataPoint(t *testing.T) { func getEncodingTestValuesNumberDataPoint() map[string]*otlpmetrics.NumberDataPoint { return map[string]*otlpmetrics.NumberDataPoint{ - "empty": {}, + "empty": NewOrigPtrNumberDataPoint(), "fill_test": func() *otlpmetrics.NumberDataPoint { - src := &otlpmetrics.NumberDataPoint{} + src := NewOrigPtrNumberDataPoint() FillOrigTestNumberDataPoint(src) return src }(), diff --git a/pdata/internal/generated_wrapper_profile_test.go b/pdata/internal/generated_wrapper_profile_test.go index 754dcde204..8c7b1b4a6c 100644 --- a/pdata/internal/generated_wrapper_profile_test.go +++ b/pdata/internal/generated_wrapper_profile_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigProfile(t *testing.T) { - src := &otlpprofiles.Profile{} - dest := &otlpprofiles.Profile{} + src := NewOrigPtrProfile() + dest := NewOrigPtrProfile() CopyOrigProfile(dest, src) - assert.Equal(t, &otlpprofiles.Profile{}, dest) + assert.Equal(t, NewOrigPtrProfile(), dest) FillOrigTestProfile(src) CopyOrigProfile(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigProfile(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigProfileUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Profile{} + dest := NewOrigPtrProfile() UnmarshalJSONOrigProfile(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.Profile{}, dest) + assert.Equal(t, NewOrigPtrProfile(), dest) } func TestMarshalAndUnmarshalJSONOrigProfile(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigProfile(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Profile{} + dest := NewOrigPtrProfile() UnmarshalJSONOrigProfile(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigProfile(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigProfileUnknown(t *testing.T) { - dest := &otlpprofiles.Profile{} + dest := NewOrigPtrProfile() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigProfile(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.Profile{}, dest) + assert.Equal(t, NewOrigPtrProfile(), dest) } func TestMarshalAndUnmarshalProtoOrigProfile(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigProfile(t *testing.T) { gotSize := MarshalProtoOrigProfile(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.Profile{} + dest := NewOrigPtrProfile() require.NoError(t, UnmarshalProtoOrigProfile(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufProfile(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.Profile{} + dest := NewOrigPtrProfile() require.NoError(t, UnmarshalProtoOrigProfile(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufProfile(t *testing.T) { func getEncodingTestValuesProfile() map[string]*otlpprofiles.Profile { return map[string]*otlpprofiles.Profile{ - "empty": {}, + "empty": NewOrigPtrProfile(), "fill_test": func() *otlpprofiles.Profile { - src := &otlpprofiles.Profile{} + src := NewOrigPtrProfile() FillOrigTestProfile(src) return src }(), diff --git a/pdata/internal/generated_wrapper_profilesdictionary_test.go b/pdata/internal/generated_wrapper_profilesdictionary_test.go index 47645dc4c9..f45af28e75 100644 --- a/pdata/internal/generated_wrapper_profilesdictionary_test.go +++ b/pdata/internal/generated_wrapper_profilesdictionary_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigProfilesDictionary(t *testing.T) { - src := &otlpprofiles.ProfilesDictionary{} - dest := &otlpprofiles.ProfilesDictionary{} + src := NewOrigPtrProfilesDictionary() + dest := NewOrigPtrProfilesDictionary() CopyOrigProfilesDictionary(dest, src) - assert.Equal(t, &otlpprofiles.ProfilesDictionary{}, dest) + assert.Equal(t, NewOrigPtrProfilesDictionary(), dest) FillOrigTestProfilesDictionary(src) CopyOrigProfilesDictionary(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigProfilesDictionary(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigProfilesDictionaryUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.ProfilesDictionary{} + dest := NewOrigPtrProfilesDictionary() UnmarshalJSONOrigProfilesDictionary(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.ProfilesDictionary{}, dest) + assert.Equal(t, NewOrigPtrProfilesDictionary(), dest) } func TestMarshalAndUnmarshalJSONOrigProfilesDictionary(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigProfilesDictionary(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.ProfilesDictionary{} + dest := NewOrigPtrProfilesDictionary() UnmarshalJSONOrigProfilesDictionary(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigProfilesDictionary(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigProfilesDictionaryUnknown(t *testing.T) { - dest := &otlpprofiles.ProfilesDictionary{} + dest := NewOrigPtrProfilesDictionary() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigProfilesDictionary(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.ProfilesDictionary{}, dest) + assert.Equal(t, NewOrigPtrProfilesDictionary(), dest) } func TestMarshalAndUnmarshalProtoOrigProfilesDictionary(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigProfilesDictionary(t *testing.T) { gotSize := MarshalProtoOrigProfilesDictionary(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.ProfilesDictionary{} + dest := NewOrigPtrProfilesDictionary() require.NoError(t, UnmarshalProtoOrigProfilesDictionary(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufProfilesDictionary(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.ProfilesDictionary{} + dest := NewOrigPtrProfilesDictionary() require.NoError(t, UnmarshalProtoOrigProfilesDictionary(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufProfilesDictionary(t *testing.T) { func getEncodingTestValuesProfilesDictionary() map[string]*otlpprofiles.ProfilesDictionary { return map[string]*otlpprofiles.ProfilesDictionary{ - "empty": {}, + "empty": NewOrigPtrProfilesDictionary(), "fill_test": func() *otlpprofiles.ProfilesDictionary { - src := &otlpprofiles.ProfilesDictionary{} + src := NewOrigPtrProfilesDictionary() FillOrigTestProfilesDictionary(src) return src }(), diff --git a/pdata/internal/generated_wrapper_resource.go b/pdata/internal/generated_wrapper_resource.go index 0f13655b72..c8701ad0cf 100644 --- a/pdata/internal/generated_wrapper_resource.go +++ b/pdata/internal/generated_wrapper_resource.go @@ -32,9 +32,9 @@ func NewResource(orig *otlpresource.Resource, state *State) Resource { } func GenerateTestResource() Resource { - orig := otlpresource.Resource{} - FillOrigTestResource(&orig) - return NewResource(&orig, NewState()) + orig := NewOrigPtrResource() + FillOrigTestResource(orig) + return NewResource(orig, NewState()) } func NewOrigResource() otlpresource.Resource { diff --git a/pdata/internal/generated_wrapper_resource_test.go b/pdata/internal/generated_wrapper_resource_test.go index 54e617fa00..4761c5c726 100644 --- a/pdata/internal/generated_wrapper_resource_test.go +++ b/pdata/internal/generated_wrapper_resource_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigResource(t *testing.T) { - src := &otlpresource.Resource{} - dest := &otlpresource.Resource{} + src := NewOrigPtrResource() + dest := NewOrigPtrResource() CopyOrigResource(dest, src) - assert.Equal(t, &otlpresource.Resource{}, dest) + assert.Equal(t, NewOrigPtrResource(), dest) FillOrigTestResource(src) CopyOrigResource(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigResource(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigResourceUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpresource.Resource{} + dest := NewOrigPtrResource() UnmarshalJSONOrigResource(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpresource.Resource{}, dest) + assert.Equal(t, NewOrigPtrResource(), dest) } func TestMarshalAndUnmarshalJSONOrigResource(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigResource(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpresource.Resource{} + dest := NewOrigPtrResource() UnmarshalJSONOrigResource(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigResource(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigResourceUnknown(t *testing.T) { - dest := &otlpresource.Resource{} + dest := NewOrigPtrResource() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigResource(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpresource.Resource{}, dest) + assert.Equal(t, NewOrigPtrResource(), dest) } func TestMarshalAndUnmarshalProtoOrigResource(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigResource(t *testing.T) { gotSize := MarshalProtoOrigResource(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpresource.Resource{} + dest := NewOrigPtrResource() require.NoError(t, UnmarshalProtoOrigResource(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufResource(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpresource.Resource{} + dest := NewOrigPtrResource() require.NoError(t, UnmarshalProtoOrigResource(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufResource(t *testing.T) { func getEncodingTestValuesResource() map[string]*otlpresource.Resource { return map[string]*otlpresource.Resource{ - "empty": {}, + "empty": NewOrigPtrResource(), "fill_test": func() *otlpresource.Resource { - src := &otlpresource.Resource{} + src := NewOrigPtrResource() FillOrigTestResource(src) return src }(), diff --git a/pdata/internal/generated_wrapper_resourcelogs_test.go b/pdata/internal/generated_wrapper_resourcelogs_test.go index 6b0927c807..889a34b325 100644 --- a/pdata/internal/generated_wrapper_resourcelogs_test.go +++ b/pdata/internal/generated_wrapper_resourcelogs_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigResourceLogs(t *testing.T) { - src := &otlplogs.ResourceLogs{} - dest := &otlplogs.ResourceLogs{} + src := NewOrigPtrResourceLogs() + dest := NewOrigPtrResourceLogs() CopyOrigResourceLogs(dest, src) - assert.Equal(t, &otlplogs.ResourceLogs{}, dest) + assert.Equal(t, NewOrigPtrResourceLogs(), dest) FillOrigTestResourceLogs(src) CopyOrigResourceLogs(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigResourceLogs(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigResourceLogsUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlplogs.ResourceLogs{} + dest := NewOrigPtrResourceLogs() UnmarshalJSONOrigResourceLogs(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlplogs.ResourceLogs{}, dest) + assert.Equal(t, NewOrigPtrResourceLogs(), dest) } func TestMarshalAndUnmarshalJSONOrigResourceLogs(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigResourceLogs(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlplogs.ResourceLogs{} + dest := NewOrigPtrResourceLogs() UnmarshalJSONOrigResourceLogs(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigResourceLogs(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigResourceLogsUnknown(t *testing.T) { - dest := &otlplogs.ResourceLogs{} + dest := NewOrigPtrResourceLogs() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigResourceLogs(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlplogs.ResourceLogs{}, dest) + assert.Equal(t, NewOrigPtrResourceLogs(), dest) } func TestMarshalAndUnmarshalProtoOrigResourceLogs(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigResourceLogs(t *testing.T) { gotSize := MarshalProtoOrigResourceLogs(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlplogs.ResourceLogs{} + dest := NewOrigPtrResourceLogs() require.NoError(t, UnmarshalProtoOrigResourceLogs(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufResourceLogs(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlplogs.ResourceLogs{} + dest := NewOrigPtrResourceLogs() require.NoError(t, UnmarshalProtoOrigResourceLogs(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufResourceLogs(t *testing.T) { func getEncodingTestValuesResourceLogs() map[string]*otlplogs.ResourceLogs { return map[string]*otlplogs.ResourceLogs{ - "empty": {}, + "empty": NewOrigPtrResourceLogs(), "fill_test": func() *otlplogs.ResourceLogs { - src := &otlplogs.ResourceLogs{} + src := NewOrigPtrResourceLogs() FillOrigTestResourceLogs(src) return src }(), diff --git a/pdata/internal/generated_wrapper_resourcemetrics_test.go b/pdata/internal/generated_wrapper_resourcemetrics_test.go index 0f0aeb9ea7..f8ec669508 100644 --- a/pdata/internal/generated_wrapper_resourcemetrics_test.go +++ b/pdata/internal/generated_wrapper_resourcemetrics_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigResourceMetrics(t *testing.T) { - src := &otlpmetrics.ResourceMetrics{} - dest := &otlpmetrics.ResourceMetrics{} + src := NewOrigPtrResourceMetrics() + dest := NewOrigPtrResourceMetrics() CopyOrigResourceMetrics(dest, src) - assert.Equal(t, &otlpmetrics.ResourceMetrics{}, dest) + assert.Equal(t, NewOrigPtrResourceMetrics(), dest) FillOrigTestResourceMetrics(src) CopyOrigResourceMetrics(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigResourceMetrics(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigResourceMetricsUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ResourceMetrics{} + dest := NewOrigPtrResourceMetrics() UnmarshalJSONOrigResourceMetrics(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.ResourceMetrics{}, dest) + assert.Equal(t, NewOrigPtrResourceMetrics(), dest) } func TestMarshalAndUnmarshalJSONOrigResourceMetrics(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigResourceMetrics(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ResourceMetrics{} + dest := NewOrigPtrResourceMetrics() UnmarshalJSONOrigResourceMetrics(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigResourceMetrics(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigResourceMetricsUnknown(t *testing.T) { - dest := &otlpmetrics.ResourceMetrics{} + dest := NewOrigPtrResourceMetrics() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigResourceMetrics(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.ResourceMetrics{}, dest) + assert.Equal(t, NewOrigPtrResourceMetrics(), dest) } func TestMarshalAndUnmarshalProtoOrigResourceMetrics(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigResourceMetrics(t *testing.T) { gotSize := MarshalProtoOrigResourceMetrics(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.ResourceMetrics{} + dest := NewOrigPtrResourceMetrics() require.NoError(t, UnmarshalProtoOrigResourceMetrics(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufResourceMetrics(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.ResourceMetrics{} + dest := NewOrigPtrResourceMetrics() require.NoError(t, UnmarshalProtoOrigResourceMetrics(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufResourceMetrics(t *testing.T) { func getEncodingTestValuesResourceMetrics() map[string]*otlpmetrics.ResourceMetrics { return map[string]*otlpmetrics.ResourceMetrics{ - "empty": {}, + "empty": NewOrigPtrResourceMetrics(), "fill_test": func() *otlpmetrics.ResourceMetrics { - src := &otlpmetrics.ResourceMetrics{} + src := NewOrigPtrResourceMetrics() FillOrigTestResourceMetrics(src) return src }(), diff --git a/pdata/internal/generated_wrapper_resourceprofiles_test.go b/pdata/internal/generated_wrapper_resourceprofiles_test.go index caad6033b8..d78d028554 100644 --- a/pdata/internal/generated_wrapper_resourceprofiles_test.go +++ b/pdata/internal/generated_wrapper_resourceprofiles_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigResourceProfiles(t *testing.T) { - src := &otlpprofiles.ResourceProfiles{} - dest := &otlpprofiles.ResourceProfiles{} + src := NewOrigPtrResourceProfiles() + dest := NewOrigPtrResourceProfiles() CopyOrigResourceProfiles(dest, src) - assert.Equal(t, &otlpprofiles.ResourceProfiles{}, dest) + assert.Equal(t, NewOrigPtrResourceProfiles(), dest) FillOrigTestResourceProfiles(src) CopyOrigResourceProfiles(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigResourceProfiles(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigResourceProfilesUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.ResourceProfiles{} + dest := NewOrigPtrResourceProfiles() UnmarshalJSONOrigResourceProfiles(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.ResourceProfiles{}, dest) + assert.Equal(t, NewOrigPtrResourceProfiles(), dest) } func TestMarshalAndUnmarshalJSONOrigResourceProfiles(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigResourceProfiles(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.ResourceProfiles{} + dest := NewOrigPtrResourceProfiles() UnmarshalJSONOrigResourceProfiles(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigResourceProfiles(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigResourceProfilesUnknown(t *testing.T) { - dest := &otlpprofiles.ResourceProfiles{} + dest := NewOrigPtrResourceProfiles() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigResourceProfiles(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.ResourceProfiles{}, dest) + assert.Equal(t, NewOrigPtrResourceProfiles(), dest) } func TestMarshalAndUnmarshalProtoOrigResourceProfiles(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigResourceProfiles(t *testing.T) { gotSize := MarshalProtoOrigResourceProfiles(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.ResourceProfiles{} + dest := NewOrigPtrResourceProfiles() require.NoError(t, UnmarshalProtoOrigResourceProfiles(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufResourceProfiles(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.ResourceProfiles{} + dest := NewOrigPtrResourceProfiles() require.NoError(t, UnmarshalProtoOrigResourceProfiles(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufResourceProfiles(t *testing.T) { func getEncodingTestValuesResourceProfiles() map[string]*otlpprofiles.ResourceProfiles { return map[string]*otlpprofiles.ResourceProfiles{ - "empty": {}, + "empty": NewOrigPtrResourceProfiles(), "fill_test": func() *otlpprofiles.ResourceProfiles { - src := &otlpprofiles.ResourceProfiles{} + src := NewOrigPtrResourceProfiles() FillOrigTestResourceProfiles(src) return src }(), diff --git a/pdata/internal/generated_wrapper_resourcespans_test.go b/pdata/internal/generated_wrapper_resourcespans_test.go index ea8a4e9811..dbe4e6097f 100644 --- a/pdata/internal/generated_wrapper_resourcespans_test.go +++ b/pdata/internal/generated_wrapper_resourcespans_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigResourceSpans(t *testing.T) { - src := &otlptrace.ResourceSpans{} - dest := &otlptrace.ResourceSpans{} + src := NewOrigPtrResourceSpans() + dest := NewOrigPtrResourceSpans() CopyOrigResourceSpans(dest, src) - assert.Equal(t, &otlptrace.ResourceSpans{}, dest) + assert.Equal(t, NewOrigPtrResourceSpans(), dest) FillOrigTestResourceSpans(src) CopyOrigResourceSpans(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigResourceSpans(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigResourceSpansUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlptrace.ResourceSpans{} + dest := NewOrigPtrResourceSpans() UnmarshalJSONOrigResourceSpans(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlptrace.ResourceSpans{}, dest) + assert.Equal(t, NewOrigPtrResourceSpans(), dest) } func TestMarshalAndUnmarshalJSONOrigResourceSpans(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigResourceSpans(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlptrace.ResourceSpans{} + dest := NewOrigPtrResourceSpans() UnmarshalJSONOrigResourceSpans(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigResourceSpans(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigResourceSpansUnknown(t *testing.T) { - dest := &otlptrace.ResourceSpans{} + dest := NewOrigPtrResourceSpans() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigResourceSpans(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlptrace.ResourceSpans{}, dest) + assert.Equal(t, NewOrigPtrResourceSpans(), dest) } func TestMarshalAndUnmarshalProtoOrigResourceSpans(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigResourceSpans(t *testing.T) { gotSize := MarshalProtoOrigResourceSpans(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlptrace.ResourceSpans{} + dest := NewOrigPtrResourceSpans() require.NoError(t, UnmarshalProtoOrigResourceSpans(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufResourceSpans(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlptrace.ResourceSpans{} + dest := NewOrigPtrResourceSpans() require.NoError(t, UnmarshalProtoOrigResourceSpans(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufResourceSpans(t *testing.T) { func getEncodingTestValuesResourceSpans() map[string]*otlptrace.ResourceSpans { return map[string]*otlptrace.ResourceSpans{ - "empty": {}, + "empty": NewOrigPtrResourceSpans(), "fill_test": func() *otlptrace.ResourceSpans { - src := &otlptrace.ResourceSpans{} + src := NewOrigPtrResourceSpans() FillOrigTestResourceSpans(src) return src }(), diff --git a/pdata/internal/generated_wrapper_sample_test.go b/pdata/internal/generated_wrapper_sample_test.go index c29ee17ab3..d009c1059f 100644 --- a/pdata/internal/generated_wrapper_sample_test.go +++ b/pdata/internal/generated_wrapper_sample_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigSample(t *testing.T) { - src := &otlpprofiles.Sample{} - dest := &otlpprofiles.Sample{} + src := NewOrigPtrSample() + dest := NewOrigPtrSample() CopyOrigSample(dest, src) - assert.Equal(t, &otlpprofiles.Sample{}, dest) + assert.Equal(t, NewOrigPtrSample(), dest) FillOrigTestSample(src) CopyOrigSample(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigSample(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigSampleUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Sample{} + dest := NewOrigPtrSample() UnmarshalJSONOrigSample(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.Sample{}, dest) + assert.Equal(t, NewOrigPtrSample(), dest) } func TestMarshalAndUnmarshalJSONOrigSample(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigSample(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.Sample{} + dest := NewOrigPtrSample() UnmarshalJSONOrigSample(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigSample(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigSampleUnknown(t *testing.T) { - dest := &otlpprofiles.Sample{} + dest := NewOrigPtrSample() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigSample(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.Sample{}, dest) + assert.Equal(t, NewOrigPtrSample(), dest) } func TestMarshalAndUnmarshalProtoOrigSample(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigSample(t *testing.T) { gotSize := MarshalProtoOrigSample(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.Sample{} + dest := NewOrigPtrSample() require.NoError(t, UnmarshalProtoOrigSample(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufSample(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.Sample{} + dest := NewOrigPtrSample() require.NoError(t, UnmarshalProtoOrigSample(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufSample(t *testing.T) { func getEncodingTestValuesSample() map[string]*otlpprofiles.Sample { return map[string]*otlpprofiles.Sample{ - "empty": {}, + "empty": NewOrigPtrSample(), "fill_test": func() *otlpprofiles.Sample { - src := &otlpprofiles.Sample{} + src := NewOrigPtrSample() FillOrigTestSample(src) return src }(), diff --git a/pdata/internal/generated_wrapper_scopelogs_test.go b/pdata/internal/generated_wrapper_scopelogs_test.go index 3ad608974d..1b9b3649d7 100644 --- a/pdata/internal/generated_wrapper_scopelogs_test.go +++ b/pdata/internal/generated_wrapper_scopelogs_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigScopeLogs(t *testing.T) { - src := &otlplogs.ScopeLogs{} - dest := &otlplogs.ScopeLogs{} + src := NewOrigPtrScopeLogs() + dest := NewOrigPtrScopeLogs() CopyOrigScopeLogs(dest, src) - assert.Equal(t, &otlplogs.ScopeLogs{}, dest) + assert.Equal(t, NewOrigPtrScopeLogs(), dest) FillOrigTestScopeLogs(src) CopyOrigScopeLogs(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigScopeLogs(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigScopeLogsUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlplogs.ScopeLogs{} + dest := NewOrigPtrScopeLogs() UnmarshalJSONOrigScopeLogs(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlplogs.ScopeLogs{}, dest) + assert.Equal(t, NewOrigPtrScopeLogs(), dest) } func TestMarshalAndUnmarshalJSONOrigScopeLogs(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigScopeLogs(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlplogs.ScopeLogs{} + dest := NewOrigPtrScopeLogs() UnmarshalJSONOrigScopeLogs(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigScopeLogs(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigScopeLogsUnknown(t *testing.T) { - dest := &otlplogs.ScopeLogs{} + dest := NewOrigPtrScopeLogs() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigScopeLogs(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlplogs.ScopeLogs{}, dest) + assert.Equal(t, NewOrigPtrScopeLogs(), dest) } func TestMarshalAndUnmarshalProtoOrigScopeLogs(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigScopeLogs(t *testing.T) { gotSize := MarshalProtoOrigScopeLogs(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlplogs.ScopeLogs{} + dest := NewOrigPtrScopeLogs() require.NoError(t, UnmarshalProtoOrigScopeLogs(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufScopeLogs(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlplogs.ScopeLogs{} + dest := NewOrigPtrScopeLogs() require.NoError(t, UnmarshalProtoOrigScopeLogs(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufScopeLogs(t *testing.T) { func getEncodingTestValuesScopeLogs() map[string]*otlplogs.ScopeLogs { return map[string]*otlplogs.ScopeLogs{ - "empty": {}, + "empty": NewOrigPtrScopeLogs(), "fill_test": func() *otlplogs.ScopeLogs { - src := &otlplogs.ScopeLogs{} + src := NewOrigPtrScopeLogs() FillOrigTestScopeLogs(src) return src }(), diff --git a/pdata/internal/generated_wrapper_scopemetrics_test.go b/pdata/internal/generated_wrapper_scopemetrics_test.go index 66dc3aaea0..18d9dcea90 100644 --- a/pdata/internal/generated_wrapper_scopemetrics_test.go +++ b/pdata/internal/generated_wrapper_scopemetrics_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigScopeMetrics(t *testing.T) { - src := &otlpmetrics.ScopeMetrics{} - dest := &otlpmetrics.ScopeMetrics{} + src := NewOrigPtrScopeMetrics() + dest := NewOrigPtrScopeMetrics() CopyOrigScopeMetrics(dest, src) - assert.Equal(t, &otlpmetrics.ScopeMetrics{}, dest) + assert.Equal(t, NewOrigPtrScopeMetrics(), dest) FillOrigTestScopeMetrics(src) CopyOrigScopeMetrics(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigScopeMetrics(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigScopeMetricsUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ScopeMetrics{} + dest := NewOrigPtrScopeMetrics() UnmarshalJSONOrigScopeMetrics(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.ScopeMetrics{}, dest) + assert.Equal(t, NewOrigPtrScopeMetrics(), dest) } func TestMarshalAndUnmarshalJSONOrigScopeMetrics(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigScopeMetrics(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.ScopeMetrics{} + dest := NewOrigPtrScopeMetrics() UnmarshalJSONOrigScopeMetrics(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigScopeMetrics(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigScopeMetricsUnknown(t *testing.T) { - dest := &otlpmetrics.ScopeMetrics{} + dest := NewOrigPtrScopeMetrics() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigScopeMetrics(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.ScopeMetrics{}, dest) + assert.Equal(t, NewOrigPtrScopeMetrics(), dest) } func TestMarshalAndUnmarshalProtoOrigScopeMetrics(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigScopeMetrics(t *testing.T) { gotSize := MarshalProtoOrigScopeMetrics(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.ScopeMetrics{} + dest := NewOrigPtrScopeMetrics() require.NoError(t, UnmarshalProtoOrigScopeMetrics(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufScopeMetrics(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.ScopeMetrics{} + dest := NewOrigPtrScopeMetrics() require.NoError(t, UnmarshalProtoOrigScopeMetrics(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufScopeMetrics(t *testing.T) { func getEncodingTestValuesScopeMetrics() map[string]*otlpmetrics.ScopeMetrics { return map[string]*otlpmetrics.ScopeMetrics{ - "empty": {}, + "empty": NewOrigPtrScopeMetrics(), "fill_test": func() *otlpmetrics.ScopeMetrics { - src := &otlpmetrics.ScopeMetrics{} + src := NewOrigPtrScopeMetrics() FillOrigTestScopeMetrics(src) return src }(), diff --git a/pdata/internal/generated_wrapper_scopeprofiles_test.go b/pdata/internal/generated_wrapper_scopeprofiles_test.go index 8bd26ff367..f8fbd330d6 100644 --- a/pdata/internal/generated_wrapper_scopeprofiles_test.go +++ b/pdata/internal/generated_wrapper_scopeprofiles_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigScopeProfiles(t *testing.T) { - src := &otlpprofiles.ScopeProfiles{} - dest := &otlpprofiles.ScopeProfiles{} + src := NewOrigPtrScopeProfiles() + dest := NewOrigPtrScopeProfiles() CopyOrigScopeProfiles(dest, src) - assert.Equal(t, &otlpprofiles.ScopeProfiles{}, dest) + assert.Equal(t, NewOrigPtrScopeProfiles(), dest) FillOrigTestScopeProfiles(src) CopyOrigScopeProfiles(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigScopeProfiles(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigScopeProfilesUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.ScopeProfiles{} + dest := NewOrigPtrScopeProfiles() UnmarshalJSONOrigScopeProfiles(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.ScopeProfiles{}, dest) + assert.Equal(t, NewOrigPtrScopeProfiles(), dest) } func TestMarshalAndUnmarshalJSONOrigScopeProfiles(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigScopeProfiles(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.ScopeProfiles{} + dest := NewOrigPtrScopeProfiles() UnmarshalJSONOrigScopeProfiles(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigScopeProfiles(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigScopeProfilesUnknown(t *testing.T) { - dest := &otlpprofiles.ScopeProfiles{} + dest := NewOrigPtrScopeProfiles() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigScopeProfiles(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.ScopeProfiles{}, dest) + assert.Equal(t, NewOrigPtrScopeProfiles(), dest) } func TestMarshalAndUnmarshalProtoOrigScopeProfiles(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigScopeProfiles(t *testing.T) { gotSize := MarshalProtoOrigScopeProfiles(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.ScopeProfiles{} + dest := NewOrigPtrScopeProfiles() require.NoError(t, UnmarshalProtoOrigScopeProfiles(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufScopeProfiles(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.ScopeProfiles{} + dest := NewOrigPtrScopeProfiles() require.NoError(t, UnmarshalProtoOrigScopeProfiles(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufScopeProfiles(t *testing.T) { func getEncodingTestValuesScopeProfiles() map[string]*otlpprofiles.ScopeProfiles { return map[string]*otlpprofiles.ScopeProfiles{ - "empty": {}, + "empty": NewOrigPtrScopeProfiles(), "fill_test": func() *otlpprofiles.ScopeProfiles { - src := &otlpprofiles.ScopeProfiles{} + src := NewOrigPtrScopeProfiles() FillOrigTestScopeProfiles(src) return src }(), diff --git a/pdata/internal/generated_wrapper_scopespans_test.go b/pdata/internal/generated_wrapper_scopespans_test.go index 8dfded0d46..d66d97e9ce 100644 --- a/pdata/internal/generated_wrapper_scopespans_test.go +++ b/pdata/internal/generated_wrapper_scopespans_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigScopeSpans(t *testing.T) { - src := &otlptrace.ScopeSpans{} - dest := &otlptrace.ScopeSpans{} + src := NewOrigPtrScopeSpans() + dest := NewOrigPtrScopeSpans() CopyOrigScopeSpans(dest, src) - assert.Equal(t, &otlptrace.ScopeSpans{}, dest) + assert.Equal(t, NewOrigPtrScopeSpans(), dest) FillOrigTestScopeSpans(src) CopyOrigScopeSpans(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigScopeSpans(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigScopeSpansUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlptrace.ScopeSpans{} + dest := NewOrigPtrScopeSpans() UnmarshalJSONOrigScopeSpans(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlptrace.ScopeSpans{}, dest) + assert.Equal(t, NewOrigPtrScopeSpans(), dest) } func TestMarshalAndUnmarshalJSONOrigScopeSpans(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigScopeSpans(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlptrace.ScopeSpans{} + dest := NewOrigPtrScopeSpans() UnmarshalJSONOrigScopeSpans(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigScopeSpans(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigScopeSpansUnknown(t *testing.T) { - dest := &otlptrace.ScopeSpans{} + dest := NewOrigPtrScopeSpans() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigScopeSpans(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlptrace.ScopeSpans{}, dest) + assert.Equal(t, NewOrigPtrScopeSpans(), dest) } func TestMarshalAndUnmarshalProtoOrigScopeSpans(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigScopeSpans(t *testing.T) { gotSize := MarshalProtoOrigScopeSpans(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlptrace.ScopeSpans{} + dest := NewOrigPtrScopeSpans() require.NoError(t, UnmarshalProtoOrigScopeSpans(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufScopeSpans(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlptrace.ScopeSpans{} + dest := NewOrigPtrScopeSpans() require.NoError(t, UnmarshalProtoOrigScopeSpans(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufScopeSpans(t *testing.T) { func getEncodingTestValuesScopeSpans() map[string]*otlptrace.ScopeSpans { return map[string]*otlptrace.ScopeSpans{ - "empty": {}, + "empty": NewOrigPtrScopeSpans(), "fill_test": func() *otlptrace.ScopeSpans { - src := &otlptrace.ScopeSpans{} + src := NewOrigPtrScopeSpans() FillOrigTestScopeSpans(src) return src }(), diff --git a/pdata/internal/generated_wrapper_span_event_test.go b/pdata/internal/generated_wrapper_span_event_test.go index 5452f1fde1..b1a06b21ce 100644 --- a/pdata/internal/generated_wrapper_span_event_test.go +++ b/pdata/internal/generated_wrapper_span_event_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigSpan_Event(t *testing.T) { - src := &otlptrace.Span_Event{} - dest := &otlptrace.Span_Event{} + src := NewOrigPtrSpan_Event() + dest := NewOrigPtrSpan_Event() CopyOrigSpan_Event(dest, src) - assert.Equal(t, &otlptrace.Span_Event{}, dest) + assert.Equal(t, NewOrigPtrSpan_Event(), dest) FillOrigTestSpan_Event(src) CopyOrigSpan_Event(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigSpan_Event(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigSpan_EventUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlptrace.Span_Event{} + dest := NewOrigPtrSpan_Event() UnmarshalJSONOrigSpan_Event(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlptrace.Span_Event{}, dest) + assert.Equal(t, NewOrigPtrSpan_Event(), dest) } func TestMarshalAndUnmarshalJSONOrigSpan_Event(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigSpan_Event(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlptrace.Span_Event{} + dest := NewOrigPtrSpan_Event() UnmarshalJSONOrigSpan_Event(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigSpan_Event(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigSpan_EventUnknown(t *testing.T) { - dest := &otlptrace.Span_Event{} + dest := NewOrigPtrSpan_Event() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigSpan_Event(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlptrace.Span_Event{}, dest) + assert.Equal(t, NewOrigPtrSpan_Event(), dest) } func TestMarshalAndUnmarshalProtoOrigSpan_Event(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigSpan_Event(t *testing.T) { gotSize := MarshalProtoOrigSpan_Event(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlptrace.Span_Event{} + dest := NewOrigPtrSpan_Event() require.NoError(t, UnmarshalProtoOrigSpan_Event(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufSpan_Event(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlptrace.Span_Event{} + dest := NewOrigPtrSpan_Event() require.NoError(t, UnmarshalProtoOrigSpan_Event(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufSpan_Event(t *testing.T) { func getEncodingTestValuesSpan_Event() map[string]*otlptrace.Span_Event { return map[string]*otlptrace.Span_Event{ - "empty": {}, + "empty": NewOrigPtrSpan_Event(), "fill_test": func() *otlptrace.Span_Event { - src := &otlptrace.Span_Event{} + src := NewOrigPtrSpan_Event() FillOrigTestSpan_Event(src) return src }(), diff --git a/pdata/internal/generated_wrapper_span_link_test.go b/pdata/internal/generated_wrapper_span_link_test.go index 79078d2917..1373b28970 100644 --- a/pdata/internal/generated_wrapper_span_link_test.go +++ b/pdata/internal/generated_wrapper_span_link_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigSpan_Link(t *testing.T) { - src := &otlptrace.Span_Link{} - dest := &otlptrace.Span_Link{} + src := NewOrigPtrSpan_Link() + dest := NewOrigPtrSpan_Link() CopyOrigSpan_Link(dest, src) - assert.Equal(t, &otlptrace.Span_Link{}, dest) + assert.Equal(t, NewOrigPtrSpan_Link(), dest) FillOrigTestSpan_Link(src) CopyOrigSpan_Link(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigSpan_Link(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigSpan_LinkUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlptrace.Span_Link{} + dest := NewOrigPtrSpan_Link() UnmarshalJSONOrigSpan_Link(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlptrace.Span_Link{}, dest) + assert.Equal(t, NewOrigPtrSpan_Link(), dest) } func TestMarshalAndUnmarshalJSONOrigSpan_Link(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigSpan_Link(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlptrace.Span_Link{} + dest := NewOrigPtrSpan_Link() UnmarshalJSONOrigSpan_Link(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigSpan_Link(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigSpan_LinkUnknown(t *testing.T) { - dest := &otlptrace.Span_Link{} + dest := NewOrigPtrSpan_Link() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigSpan_Link(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlptrace.Span_Link{}, dest) + assert.Equal(t, NewOrigPtrSpan_Link(), dest) } func TestMarshalAndUnmarshalProtoOrigSpan_Link(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigSpan_Link(t *testing.T) { gotSize := MarshalProtoOrigSpan_Link(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlptrace.Span_Link{} + dest := NewOrigPtrSpan_Link() require.NoError(t, UnmarshalProtoOrigSpan_Link(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufSpan_Link(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlptrace.Span_Link{} + dest := NewOrigPtrSpan_Link() require.NoError(t, UnmarshalProtoOrigSpan_Link(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufSpan_Link(t *testing.T) { func getEncodingTestValuesSpan_Link() map[string]*otlptrace.Span_Link { return map[string]*otlptrace.Span_Link{ - "empty": {}, + "empty": NewOrigPtrSpan_Link(), "fill_test": func() *otlptrace.Span_Link { - src := &otlptrace.Span_Link{} + src := NewOrigPtrSpan_Link() FillOrigTestSpan_Link(src) return src }(), diff --git a/pdata/internal/generated_wrapper_span_test.go b/pdata/internal/generated_wrapper_span_test.go index 259af50468..118032c82f 100644 --- a/pdata/internal/generated_wrapper_span_test.go +++ b/pdata/internal/generated_wrapper_span_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigSpan(t *testing.T) { - src := &otlptrace.Span{} - dest := &otlptrace.Span{} + src := NewOrigPtrSpan() + dest := NewOrigPtrSpan() CopyOrigSpan(dest, src) - assert.Equal(t, &otlptrace.Span{}, dest) + assert.Equal(t, NewOrigPtrSpan(), dest) FillOrigTestSpan(src) CopyOrigSpan(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigSpan(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigSpanUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlptrace.Span{} + dest := NewOrigPtrSpan() UnmarshalJSONOrigSpan(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlptrace.Span{}, dest) + assert.Equal(t, NewOrigPtrSpan(), dest) } func TestMarshalAndUnmarshalJSONOrigSpan(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigSpan(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlptrace.Span{} + dest := NewOrigPtrSpan() UnmarshalJSONOrigSpan(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigSpan(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigSpanUnknown(t *testing.T) { - dest := &otlptrace.Span{} + dest := NewOrigPtrSpan() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigSpan(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlptrace.Span{}, dest) + assert.Equal(t, NewOrigPtrSpan(), dest) } func TestMarshalAndUnmarshalProtoOrigSpan(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigSpan(t *testing.T) { gotSize := MarshalProtoOrigSpan(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlptrace.Span{} + dest := NewOrigPtrSpan() require.NoError(t, UnmarshalProtoOrigSpan(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufSpan(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlptrace.Span{} + dest := NewOrigPtrSpan() require.NoError(t, UnmarshalProtoOrigSpan(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufSpan(t *testing.T) { func getEncodingTestValuesSpan() map[string]*otlptrace.Span { return map[string]*otlptrace.Span{ - "empty": {}, + "empty": NewOrigPtrSpan(), "fill_test": func() *otlptrace.Span { - src := &otlptrace.Span{} + src := NewOrigPtrSpan() FillOrigTestSpan(src) return src }(), diff --git a/pdata/internal/generated_wrapper_status_test.go b/pdata/internal/generated_wrapper_status_test.go index 3d7daafbfc..54b24e6367 100644 --- a/pdata/internal/generated_wrapper_status_test.go +++ b/pdata/internal/generated_wrapper_status_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigStatus(t *testing.T) { - src := &otlptrace.Status{} - dest := &otlptrace.Status{} + src := NewOrigPtrStatus() + dest := NewOrigPtrStatus() CopyOrigStatus(dest, src) - assert.Equal(t, &otlptrace.Status{}, dest) + assert.Equal(t, NewOrigPtrStatus(), dest) FillOrigTestStatus(src) CopyOrigStatus(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigStatus(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigStatusUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlptrace.Status{} + dest := NewOrigPtrStatus() UnmarshalJSONOrigStatus(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlptrace.Status{}, dest) + assert.Equal(t, NewOrigPtrStatus(), dest) } func TestMarshalAndUnmarshalJSONOrigStatus(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigStatus(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlptrace.Status{} + dest := NewOrigPtrStatus() UnmarshalJSONOrigStatus(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigStatus(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigStatusUnknown(t *testing.T) { - dest := &otlptrace.Status{} + dest := NewOrigPtrStatus() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigStatus(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlptrace.Status{}, dest) + assert.Equal(t, NewOrigPtrStatus(), dest) } func TestMarshalAndUnmarshalProtoOrigStatus(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigStatus(t *testing.T) { gotSize := MarshalProtoOrigStatus(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlptrace.Status{} + dest := NewOrigPtrStatus() require.NoError(t, UnmarshalProtoOrigStatus(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufStatus(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlptrace.Status{} + dest := NewOrigPtrStatus() require.NoError(t, UnmarshalProtoOrigStatus(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufStatus(t *testing.T) { func getEncodingTestValuesStatus() map[string]*otlptrace.Status { return map[string]*otlptrace.Status{ - "empty": {}, + "empty": NewOrigPtrStatus(), "fill_test": func() *otlptrace.Status { - src := &otlptrace.Status{} + src := NewOrigPtrStatus() FillOrigTestStatus(src) return src }(), diff --git a/pdata/internal/generated_wrapper_sum_test.go b/pdata/internal/generated_wrapper_sum_test.go index 7edf5f2253..50e4921a45 100644 --- a/pdata/internal/generated_wrapper_sum_test.go +++ b/pdata/internal/generated_wrapper_sum_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigSum(t *testing.T) { - src := &otlpmetrics.Sum{} - dest := &otlpmetrics.Sum{} + src := NewOrigPtrSum() + dest := NewOrigPtrSum() CopyOrigSum(dest, src) - assert.Equal(t, &otlpmetrics.Sum{}, dest) + assert.Equal(t, NewOrigPtrSum(), dest) FillOrigTestSum(src) CopyOrigSum(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigSum(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigSumUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Sum{} + dest := NewOrigPtrSum() UnmarshalJSONOrigSum(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.Sum{}, dest) + assert.Equal(t, NewOrigPtrSum(), dest) } func TestMarshalAndUnmarshalJSONOrigSum(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigSum(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Sum{} + dest := NewOrigPtrSum() UnmarshalJSONOrigSum(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigSum(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigSumUnknown(t *testing.T) { - dest := &otlpmetrics.Sum{} + dest := NewOrigPtrSum() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigSum(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.Sum{}, dest) + assert.Equal(t, NewOrigPtrSum(), dest) } func TestMarshalAndUnmarshalProtoOrigSum(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigSum(t *testing.T) { gotSize := MarshalProtoOrigSum(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.Sum{} + dest := NewOrigPtrSum() require.NoError(t, UnmarshalProtoOrigSum(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufSum(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.Sum{} + dest := NewOrigPtrSum() require.NoError(t, UnmarshalProtoOrigSum(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufSum(t *testing.T) { func getEncodingTestValuesSum() map[string]*otlpmetrics.Sum { return map[string]*otlpmetrics.Sum{ - "empty": {}, + "empty": NewOrigPtrSum(), "fill_test": func() *otlpmetrics.Sum { - src := &otlpmetrics.Sum{} + src := NewOrigPtrSum() FillOrigTestSum(src) return src }(), diff --git a/pdata/internal/generated_wrapper_summary_test.go b/pdata/internal/generated_wrapper_summary_test.go index 9936a21cb7..1b71b0286b 100644 --- a/pdata/internal/generated_wrapper_summary_test.go +++ b/pdata/internal/generated_wrapper_summary_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigSummary(t *testing.T) { - src := &otlpmetrics.Summary{} - dest := &otlpmetrics.Summary{} + src := NewOrigPtrSummary() + dest := NewOrigPtrSummary() CopyOrigSummary(dest, src) - assert.Equal(t, &otlpmetrics.Summary{}, dest) + assert.Equal(t, NewOrigPtrSummary(), dest) FillOrigTestSummary(src) CopyOrigSummary(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigSummary(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigSummaryUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Summary{} + dest := NewOrigPtrSummary() UnmarshalJSONOrigSummary(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.Summary{}, dest) + assert.Equal(t, NewOrigPtrSummary(), dest) } func TestMarshalAndUnmarshalJSONOrigSummary(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigSummary(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.Summary{} + dest := NewOrigPtrSummary() UnmarshalJSONOrigSummary(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigSummary(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigSummaryUnknown(t *testing.T) { - dest := &otlpmetrics.Summary{} + dest := NewOrigPtrSummary() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigSummary(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.Summary{}, dest) + assert.Equal(t, NewOrigPtrSummary(), dest) } func TestMarshalAndUnmarshalProtoOrigSummary(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigSummary(t *testing.T) { gotSize := MarshalProtoOrigSummary(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.Summary{} + dest := NewOrigPtrSummary() require.NoError(t, UnmarshalProtoOrigSummary(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufSummary(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.Summary{} + dest := NewOrigPtrSummary() require.NoError(t, UnmarshalProtoOrigSummary(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufSummary(t *testing.T) { func getEncodingTestValuesSummary() map[string]*otlpmetrics.Summary { return map[string]*otlpmetrics.Summary{ - "empty": {}, + "empty": NewOrigPtrSummary(), "fill_test": func() *otlpmetrics.Summary { - src := &otlpmetrics.Summary{} + src := NewOrigPtrSummary() FillOrigTestSummary(src) return src }(), diff --git a/pdata/internal/generated_wrapper_summarydatapoint_test.go b/pdata/internal/generated_wrapper_summarydatapoint_test.go index fe384cde34..b9550c9786 100644 --- a/pdata/internal/generated_wrapper_summarydatapoint_test.go +++ b/pdata/internal/generated_wrapper_summarydatapoint_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigSummaryDataPoint(t *testing.T) { - src := &otlpmetrics.SummaryDataPoint{} - dest := &otlpmetrics.SummaryDataPoint{} + src := NewOrigPtrSummaryDataPoint() + dest := NewOrigPtrSummaryDataPoint() CopyOrigSummaryDataPoint(dest, src) - assert.Equal(t, &otlpmetrics.SummaryDataPoint{}, dest) + assert.Equal(t, NewOrigPtrSummaryDataPoint(), dest) FillOrigTestSummaryDataPoint(src) CopyOrigSummaryDataPoint(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigSummaryDataPoint(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigSummaryDataPointUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.SummaryDataPoint{} + dest := NewOrigPtrSummaryDataPoint() UnmarshalJSONOrigSummaryDataPoint(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.SummaryDataPoint{}, dest) + assert.Equal(t, NewOrigPtrSummaryDataPoint(), dest) } func TestMarshalAndUnmarshalJSONOrigSummaryDataPoint(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigSummaryDataPoint(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.SummaryDataPoint{} + dest := NewOrigPtrSummaryDataPoint() UnmarshalJSONOrigSummaryDataPoint(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigSummaryDataPoint(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigSummaryDataPointUnknown(t *testing.T) { - dest := &otlpmetrics.SummaryDataPoint{} + dest := NewOrigPtrSummaryDataPoint() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigSummaryDataPoint(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.SummaryDataPoint{}, dest) + assert.Equal(t, NewOrigPtrSummaryDataPoint(), dest) } func TestMarshalAndUnmarshalProtoOrigSummaryDataPoint(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigSummaryDataPoint(t *testing.T) { gotSize := MarshalProtoOrigSummaryDataPoint(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.SummaryDataPoint{} + dest := NewOrigPtrSummaryDataPoint() require.NoError(t, UnmarshalProtoOrigSummaryDataPoint(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufSummaryDataPoint(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.SummaryDataPoint{} + dest := NewOrigPtrSummaryDataPoint() require.NoError(t, UnmarshalProtoOrigSummaryDataPoint(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufSummaryDataPoint(t *testing.T) { func getEncodingTestValuesSummaryDataPoint() map[string]*otlpmetrics.SummaryDataPoint { return map[string]*otlpmetrics.SummaryDataPoint{ - "empty": {}, + "empty": NewOrigPtrSummaryDataPoint(), "fill_test": func() *otlpmetrics.SummaryDataPoint { - src := &otlpmetrics.SummaryDataPoint{} + src := NewOrigPtrSummaryDataPoint() FillOrigTestSummaryDataPoint(src) return src }(), diff --git a/pdata/internal/generated_wrapper_summarydatapoint_valueatquantile_test.go b/pdata/internal/generated_wrapper_summarydatapoint_valueatquantile_test.go index b295f87e22..cdfb50536b 100644 --- a/pdata/internal/generated_wrapper_summarydatapoint_valueatquantile_test.go +++ b/pdata/internal/generated_wrapper_summarydatapoint_valueatquantile_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigSummaryDataPoint_ValueAtQuantile(t *testing.T) { - src := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} - dest := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + src := NewOrigPtrSummaryDataPoint_ValueAtQuantile() + dest := NewOrigPtrSummaryDataPoint_ValueAtQuantile() CopyOrigSummaryDataPoint_ValueAtQuantile(dest, src) - assert.Equal(t, &otlpmetrics.SummaryDataPoint_ValueAtQuantile{}, dest) + assert.Equal(t, NewOrigPtrSummaryDataPoint_ValueAtQuantile(), dest) FillOrigTestSummaryDataPoint_ValueAtQuantile(src) CopyOrigSummaryDataPoint_ValueAtQuantile(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigSummaryDataPoint_ValueAtQuantile(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigSummaryDataPoint_ValueAtQuantileUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + dest := NewOrigPtrSummaryDataPoint_ValueAtQuantile() UnmarshalJSONOrigSummaryDataPoint_ValueAtQuantile(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpmetrics.SummaryDataPoint_ValueAtQuantile{}, dest) + assert.Equal(t, NewOrigPtrSummaryDataPoint_ValueAtQuantile(), dest) } func TestMarshalAndUnmarshalJSONOrigSummaryDataPoint_ValueAtQuantile(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigSummaryDataPoint_ValueAtQuantile(t *testing. iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + dest := NewOrigPtrSummaryDataPoint_ValueAtQuantile() UnmarshalJSONOrigSummaryDataPoint_ValueAtQuantile(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigSummaryDataPoint_ValueAtQuantile(t *testing. } func TestMarshalAndUnmarshalProtoOrigSummaryDataPoint_ValueAtQuantileUnknown(t *testing.T) { - dest := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + dest := NewOrigPtrSummaryDataPoint_ValueAtQuantile() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigSummaryDataPoint_ValueAtQuantile(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpmetrics.SummaryDataPoint_ValueAtQuantile{}, dest) + assert.Equal(t, NewOrigPtrSummaryDataPoint_ValueAtQuantile(), dest) } func TestMarshalAndUnmarshalProtoOrigSummaryDataPoint_ValueAtQuantile(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigSummaryDataPoint_ValueAtQuantile(t *testing gotSize := MarshalProtoOrigSummaryDataPoint_ValueAtQuantile(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + dest := NewOrigPtrSummaryDataPoint_ValueAtQuantile() require.NoError(t, UnmarshalProtoOrigSummaryDataPoint_ValueAtQuantile(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufSummaryDataPoint_ValueAtQuantile(t * goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + dest := NewOrigPtrSummaryDataPoint_ValueAtQuantile() require.NoError(t, UnmarshalProtoOrigSummaryDataPoint_ValueAtQuantile(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufSummaryDataPoint_ValueAtQuantile(t * func getEncodingTestValuesSummaryDataPoint_ValueAtQuantile() map[string]*otlpmetrics.SummaryDataPoint_ValueAtQuantile { return map[string]*otlpmetrics.SummaryDataPoint_ValueAtQuantile{ - "empty": {}, + "empty": NewOrigPtrSummaryDataPoint_ValueAtQuantile(), "fill_test": func() *otlpmetrics.SummaryDataPoint_ValueAtQuantile { - src := &otlpmetrics.SummaryDataPoint_ValueAtQuantile{} + src := NewOrigPtrSummaryDataPoint_ValueAtQuantile() FillOrigTestSummaryDataPoint_ValueAtQuantile(src) return src }(), diff --git a/pdata/internal/generated_wrapper_valuetype_test.go b/pdata/internal/generated_wrapper_valuetype_test.go index 42fe28aef7..ca858abff5 100644 --- a/pdata/internal/generated_wrapper_valuetype_test.go +++ b/pdata/internal/generated_wrapper_valuetype_test.go @@ -19,10 +19,10 @@ import ( ) func TestCopyOrigValueType(t *testing.T) { - src := &otlpprofiles.ValueType{} - dest := &otlpprofiles.ValueType{} + src := NewOrigPtrValueType() + dest := NewOrigPtrValueType() CopyOrigValueType(dest, src) - assert.Equal(t, &otlpprofiles.ValueType{}, dest) + assert.Equal(t, NewOrigPtrValueType(), dest) FillOrigTestValueType(src) CopyOrigValueType(dest, src) assert.Equal(t, src, dest) @@ -31,10 +31,10 @@ func TestCopyOrigValueType(t *testing.T) { func TestMarshalAndUnmarshalJSONOrigValueTypeUnknown(t *testing.T) { iter := json.BorrowIterator([]byte(`{"unknown": "string"}`)) defer json.ReturnIterator(iter) - dest := &otlpprofiles.ValueType{} + dest := NewOrigPtrValueType() UnmarshalJSONOrigValueType(dest, iter) require.NoError(t, iter.Error()) - assert.Equal(t, &otlpprofiles.ValueType{}, dest) + assert.Equal(t, NewOrigPtrValueType(), dest) } func TestMarshalAndUnmarshalJSONOrigValueType(t *testing.T) { @@ -47,7 +47,7 @@ func TestMarshalAndUnmarshalJSONOrigValueType(t *testing.T) { iter := json.BorrowIterator(stream.Buffer()) defer json.ReturnIterator(iter) - dest := &otlpprofiles.ValueType{} + dest := NewOrigPtrValueType() UnmarshalJSONOrigValueType(dest, iter) require.NoError(t, iter.Error()) @@ -57,10 +57,10 @@ func TestMarshalAndUnmarshalJSONOrigValueType(t *testing.T) { } func TestMarshalAndUnmarshalProtoOrigValueTypeUnknown(t *testing.T) { - dest := &otlpprofiles.ValueType{} + dest := NewOrigPtrValueType() // message Test { required int64 field = 1313; } encoding { "field": "1234" } require.NoError(t, UnmarshalProtoOrigValueType(dest, []byte{0x88, 0x52, 0xD2, 0x09})) - assert.Equal(t, &otlpprofiles.ValueType{}, dest) + assert.Equal(t, NewOrigPtrValueType(), dest) } func TestMarshalAndUnmarshalProtoOrigValueType(t *testing.T) { @@ -70,7 +70,7 @@ func TestMarshalAndUnmarshalProtoOrigValueType(t *testing.T) { gotSize := MarshalProtoOrigValueType(src, buf) assert.Equal(t, len(buf), gotSize) - dest := &otlpprofiles.ValueType{} + dest := NewOrigPtrValueType() require.NoError(t, UnmarshalProtoOrigValueType(dest, buf)) assert.Equal(t, src, dest) }) @@ -90,7 +90,7 @@ func TestMarshalAndUnmarshalProtoViaProtobufValueType(t *testing.T) { goBuf, err := proto.Marshal(goDest) require.NoError(t, err) - dest := &otlpprofiles.ValueType{} + dest := NewOrigPtrValueType() require.NoError(t, UnmarshalProtoOrigValueType(dest, goBuf)) assert.Equal(t, src, dest) }) @@ -99,9 +99,9 @@ func TestMarshalAndUnmarshalProtoViaProtobufValueType(t *testing.T) { func getEncodingTestValuesValueType() map[string]*otlpprofiles.ValueType { return map[string]*otlpprofiles.ValueType{ - "empty": {}, + "empty": NewOrigPtrValueType(), "fill_test": func() *otlpprofiles.ValueType { - src := &otlpprofiles.ValueType{} + src := NewOrigPtrValueType() FillOrigTestValueType(src) return src }(), diff --git a/pdata/pcommon/generated_instrumentationscope.go b/pdata/pcommon/generated_instrumentationscope.go index 4f22f0c82f..6c46dc363a 100644 --- a/pdata/pcommon/generated_instrumentationscope.go +++ b/pdata/pcommon/generated_instrumentationscope.go @@ -29,7 +29,7 @@ func newInstrumentationScope(orig *otlpcommon.InstrumentationScope, state *inter // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewInstrumentationScope() InstrumentationScope { - return newInstrumentationScope(&otlpcommon.InstrumentationScope{}, internal.NewState()) + return newInstrumentationScope(internal.NewOrigPtrInstrumentationScope(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pcommon/generated_instrumentationscope_test.go b/pdata/pcommon/generated_instrumentationscope_test.go index 032428706b..fa73076ea0 100644 --- a/pdata/pcommon/generated_instrumentationscope_test.go +++ b/pdata/pcommon/generated_instrumentationscope_test.go @@ -25,8 +25,8 @@ func TestInstrumentationScope_MoveTo(t *testing.T) { assert.Equal(t, generateTestInstrumentationScope(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newInstrumentationScope(&otlpcommon.InstrumentationScope{}, sharedState)) }) - assert.Panics(t, func() { newInstrumentationScope(&otlpcommon.InstrumentationScope{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newInstrumentationScope(internal.NewOrigPtrInstrumentationScope(), sharedState)) }) + assert.Panics(t, func() { newInstrumentationScope(internal.NewOrigPtrInstrumentationScope(), sharedState).MoveTo(dest) }) } func TestInstrumentationScope_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestInstrumentationScope_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newInstrumentationScope(&otlpcommon.InstrumentationScope{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newInstrumentationScope(internal.NewOrigPtrInstrumentationScope(), sharedState)) }) } func TestInstrumentationScope_Name(t *testing.T) { diff --git a/pdata/pcommon/generated_resource.go b/pdata/pcommon/generated_resource.go index c3e70d97e8..508207a798 100644 --- a/pdata/pcommon/generated_resource.go +++ b/pdata/pcommon/generated_resource.go @@ -29,7 +29,7 @@ func newResource(orig *otlpresource.Resource, state *internal.State) Resource { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewResource() Resource { - return newResource(&otlpresource.Resource{}, internal.NewState()) + return newResource(internal.NewOrigPtrResource(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pcommon/generated_resource_test.go b/pdata/pcommon/generated_resource_test.go index 5b7f1ddb7c..177e455822 100644 --- a/pdata/pcommon/generated_resource_test.go +++ b/pdata/pcommon/generated_resource_test.go @@ -25,8 +25,8 @@ func TestResource_MoveTo(t *testing.T) { assert.Equal(t, generateTestResource(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newResource(&otlpresource.Resource{}, sharedState)) }) - assert.Panics(t, func() { newResource(&otlpresource.Resource{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newResource(internal.NewOrigPtrResource(), sharedState)) }) + assert.Panics(t, func() { newResource(internal.NewOrigPtrResource(), sharedState).MoveTo(dest) }) } func TestResource_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestResource_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newResource(&otlpresource.Resource{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newResource(internal.NewOrigPtrResource(), sharedState)) }) } func TestResource_Attributes(t *testing.T) { diff --git a/pdata/plog/generated_logrecord.go b/pdata/plog/generated_logrecord.go index 8ecea1061e..00b33a6042 100644 --- a/pdata/plog/generated_logrecord.go +++ b/pdata/plog/generated_logrecord.go @@ -34,7 +34,7 @@ func newLogRecord(orig *otlplogs.LogRecord, state *internal.State) LogRecord { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewLogRecord() LogRecord { - return newLogRecord(&otlplogs.LogRecord{}, internal.NewState()) + return newLogRecord(internal.NewOrigPtrLogRecord(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/plog/generated_logrecord_test.go b/pdata/plog/generated_logrecord_test.go index b4ad8fb059..f109775fed 100644 --- a/pdata/plog/generated_logrecord_test.go +++ b/pdata/plog/generated_logrecord_test.go @@ -27,8 +27,8 @@ func TestLogRecord_MoveTo(t *testing.T) { assert.Equal(t, generateTestLogRecord(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newLogRecord(&otlplogs.LogRecord{}, sharedState)) }) - assert.Panics(t, func() { newLogRecord(&otlplogs.LogRecord{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newLogRecord(internal.NewOrigPtrLogRecord(), sharedState)) }) + assert.Panics(t, func() { newLogRecord(internal.NewOrigPtrLogRecord(), sharedState).MoveTo(dest) }) } func TestLogRecord_CopyTo(t *testing.T) { @@ -41,7 +41,7 @@ func TestLogRecord_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newLogRecord(&otlplogs.LogRecord{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newLogRecord(internal.NewOrigPtrLogRecord(), sharedState)) }) } func TestLogRecord_Timestamp(t *testing.T) { diff --git a/pdata/plog/generated_logs.go b/pdata/plog/generated_logs.go index 7ff82a7c1e..0c70eba36b 100644 --- a/pdata/plog/generated_logs.go +++ b/pdata/plog/generated_logs.go @@ -30,7 +30,7 @@ func newLogs(orig *otlpcollectorlogs.ExportLogsServiceRequest, state *internal.S // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewLogs() Logs { - return newLogs(&otlpcollectorlogs.ExportLogsServiceRequest{}, internal.NewState()) + return newLogs(internal.NewOrigPtrExportLogsServiceRequest(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/plog/generated_logs_test.go b/pdata/plog/generated_logs_test.go index 09f5102cb3..316783f6be 100644 --- a/pdata/plog/generated_logs_test.go +++ b/pdata/plog/generated_logs_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorlogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1" ) func TestLogs_MoveTo(t *testing.T) { @@ -25,8 +24,8 @@ func TestLogs_MoveTo(t *testing.T) { assert.Equal(t, generateTestLogs(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newLogs(&otlpcollectorlogs.ExportLogsServiceRequest{}, sharedState)) }) - assert.Panics(t, func() { newLogs(&otlpcollectorlogs.ExportLogsServiceRequest{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newLogs(internal.NewOrigPtrExportLogsServiceRequest(), sharedState)) }) + assert.Panics(t, func() { newLogs(internal.NewOrigPtrExportLogsServiceRequest(), sharedState).MoveTo(dest) }) } func TestLogs_CopyTo(t *testing.T) { @@ -39,7 +38,7 @@ func TestLogs_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newLogs(&otlpcollectorlogs.ExportLogsServiceRequest{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newLogs(internal.NewOrigPtrExportLogsServiceRequest(), sharedState)) }) } func TestLogs_ResourceLogs(t *testing.T) { diff --git a/pdata/plog/generated_resourcelogs.go b/pdata/plog/generated_resourcelogs.go index 765ce8f88d..b11b7d3ab7 100644 --- a/pdata/plog/generated_resourcelogs.go +++ b/pdata/plog/generated_resourcelogs.go @@ -33,7 +33,7 @@ func newResourceLogs(orig *otlplogs.ResourceLogs, state *internal.State) Resourc // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewResourceLogs() ResourceLogs { - return newResourceLogs(&otlplogs.ResourceLogs{}, internal.NewState()) + return newResourceLogs(internal.NewOrigPtrResourceLogs(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/plog/generated_resourcelogs_test.go b/pdata/plog/generated_resourcelogs_test.go index 59021c7e5e..33ed817a0a 100644 --- a/pdata/plog/generated_resourcelogs_test.go +++ b/pdata/plog/generated_resourcelogs_test.go @@ -26,8 +26,8 @@ func TestResourceLogs_MoveTo(t *testing.T) { assert.Equal(t, generateTestResourceLogs(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newResourceLogs(&otlplogs.ResourceLogs{}, sharedState)) }) - assert.Panics(t, func() { newResourceLogs(&otlplogs.ResourceLogs{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newResourceLogs(internal.NewOrigPtrResourceLogs(), sharedState)) }) + assert.Panics(t, func() { newResourceLogs(internal.NewOrigPtrResourceLogs(), sharedState).MoveTo(dest) }) } func TestResourceLogs_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestResourceLogs_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newResourceLogs(&otlplogs.ResourceLogs{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newResourceLogs(internal.NewOrigPtrResourceLogs(), sharedState)) }) } func TestResourceLogs_Resource(t *testing.T) { diff --git a/pdata/plog/generated_scopelogs.go b/pdata/plog/generated_scopelogs.go index abad4f77f9..cbee2519d0 100644 --- a/pdata/plog/generated_scopelogs.go +++ b/pdata/plog/generated_scopelogs.go @@ -33,7 +33,7 @@ func newScopeLogs(orig *otlplogs.ScopeLogs, state *internal.State) ScopeLogs { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewScopeLogs() ScopeLogs { - return newScopeLogs(&otlplogs.ScopeLogs{}, internal.NewState()) + return newScopeLogs(internal.NewOrigPtrScopeLogs(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/plog/generated_scopelogs_test.go b/pdata/plog/generated_scopelogs_test.go index 3cd73b84b4..2d4ff52800 100644 --- a/pdata/plog/generated_scopelogs_test.go +++ b/pdata/plog/generated_scopelogs_test.go @@ -26,8 +26,8 @@ func TestScopeLogs_MoveTo(t *testing.T) { assert.Equal(t, generateTestScopeLogs(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newScopeLogs(&otlplogs.ScopeLogs{}, sharedState)) }) - assert.Panics(t, func() { newScopeLogs(&otlplogs.ScopeLogs{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newScopeLogs(internal.NewOrigPtrScopeLogs(), sharedState)) }) + assert.Panics(t, func() { newScopeLogs(internal.NewOrigPtrScopeLogs(), sharedState).MoveTo(dest) }) } func TestScopeLogs_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestScopeLogs_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newScopeLogs(&otlplogs.ScopeLogs{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newScopeLogs(internal.NewOrigPtrScopeLogs(), sharedState)) }) } func TestScopeLogs_Scope(t *testing.T) { diff --git a/pdata/plog/plogotlp/generated_exportpartialsuccess.go b/pdata/plog/plogotlp/generated_exportpartialsuccess.go index df871e41fe..c8bc1c58e0 100644 --- a/pdata/plog/plogotlp/generated_exportpartialsuccess.go +++ b/pdata/plog/plogotlp/generated_exportpartialsuccess.go @@ -32,7 +32,7 @@ func newExportPartialSuccess(orig *otlpcollectorlogs.ExportLogsPartialSuccess, s // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExportPartialSuccess() ExportPartialSuccess { - return newExportPartialSuccess(&otlpcollectorlogs.ExportLogsPartialSuccess{}, internal.NewState()) + return newExportPartialSuccess(internal.NewOrigPtrExportLogsPartialSuccess(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/plog/plogotlp/generated_exportpartialsuccess_test.go b/pdata/plog/plogotlp/generated_exportpartialsuccess_test.go index 40493527d5..cfe21f2ca4 100644 --- a/pdata/plog/plogotlp/generated_exportpartialsuccess_test.go +++ b/pdata/plog/plogotlp/generated_exportpartialsuccess_test.go @@ -25,9 +25,9 @@ func TestExportPartialSuccess_MoveTo(t *testing.T) { assert.Equal(t, generateTestExportPartialSuccess(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newExportPartialSuccess(&otlpcollectorlogs.ExportLogsPartialSuccess{}, sharedState)) }) + assert.Panics(t, func() { ms.MoveTo(newExportPartialSuccess(internal.NewOrigPtrExportLogsPartialSuccess(), sharedState)) }) assert.Panics(t, func() { - newExportPartialSuccess(&otlpcollectorlogs.ExportLogsPartialSuccess{}, sharedState).MoveTo(dest) + newExportPartialSuccess(internal.NewOrigPtrExportLogsPartialSuccess(), sharedState).MoveTo(dest) }) } @@ -41,7 +41,7 @@ func TestExportPartialSuccess_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newExportPartialSuccess(&otlpcollectorlogs.ExportLogsPartialSuccess{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newExportPartialSuccess(internal.NewOrigPtrExportLogsPartialSuccess(), sharedState)) }) } func TestExportPartialSuccess_RejectedLogRecords(t *testing.T) { diff --git a/pdata/plog/plogotlp/generated_exportresponse.go b/pdata/plog/plogotlp/generated_exportresponse.go index 0434eb28f5..f05f75a3ae 100644 --- a/pdata/plog/plogotlp/generated_exportresponse.go +++ b/pdata/plog/plogotlp/generated_exportresponse.go @@ -32,7 +32,7 @@ func newExportResponse(orig *otlpcollectorlogs.ExportLogsServiceResponse, state // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExportResponse() ExportResponse { - return newExportResponse(&otlpcollectorlogs.ExportLogsServiceResponse{}, internal.NewState()) + return newExportResponse(internal.NewOrigPtrExportLogsServiceResponse(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/plog/plogotlp/generated_exportresponse_test.go b/pdata/plog/plogotlp/generated_exportresponse_test.go index 21bb8ce6b0..11431579ea 100644 --- a/pdata/plog/plogotlp/generated_exportresponse_test.go +++ b/pdata/plog/plogotlp/generated_exportresponse_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorlogs "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/logs/v1" ) func TestExportResponse_MoveTo(t *testing.T) { @@ -25,8 +24,8 @@ func TestExportResponse_MoveTo(t *testing.T) { assert.Equal(t, generateTestExportResponse(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newExportResponse(&otlpcollectorlogs.ExportLogsServiceResponse{}, sharedState)) }) - assert.Panics(t, func() { newExportResponse(&otlpcollectorlogs.ExportLogsServiceResponse{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newExportResponse(internal.NewOrigPtrExportLogsServiceResponse(), sharedState)) }) + assert.Panics(t, func() { newExportResponse(internal.NewOrigPtrExportLogsServiceResponse(), sharedState).MoveTo(dest) }) } func TestExportResponse_CopyTo(t *testing.T) { @@ -39,7 +38,7 @@ func TestExportResponse_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newExportResponse(&otlpcollectorlogs.ExportLogsServiceResponse{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newExportResponse(internal.NewOrigPtrExportLogsServiceResponse(), sharedState)) }) } func TestExportResponse_PartialSuccess(t *testing.T) { diff --git a/pdata/pmetric/generated_exemplar.go b/pdata/pmetric/generated_exemplar.go index 27fa3a5d13..7098d052d1 100644 --- a/pdata/pmetric/generated_exemplar.go +++ b/pdata/pmetric/generated_exemplar.go @@ -37,7 +37,7 @@ func newExemplar(orig *otlpmetrics.Exemplar, state *internal.State) Exemplar { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExemplar() Exemplar { - return newExemplar(&otlpmetrics.Exemplar{}, internal.NewState()) + return newExemplar(internal.NewOrigPtrExemplar(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_exemplar_test.go b/pdata/pmetric/generated_exemplar_test.go index 5cfe002ef1..35d8cf439c 100644 --- a/pdata/pmetric/generated_exemplar_test.go +++ b/pdata/pmetric/generated_exemplar_test.go @@ -27,8 +27,8 @@ func TestExemplar_MoveTo(t *testing.T) { assert.Equal(t, generateTestExemplar(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newExemplar(&otlpmetrics.Exemplar{}, sharedState)) }) - assert.Panics(t, func() { newExemplar(&otlpmetrics.Exemplar{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newExemplar(internal.NewOrigPtrExemplar(), sharedState)) }) + assert.Panics(t, func() { newExemplar(internal.NewOrigPtrExemplar(), sharedState).MoveTo(dest) }) } func TestExemplar_CopyTo(t *testing.T) { @@ -41,7 +41,7 @@ func TestExemplar_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newExemplar(&otlpmetrics.Exemplar{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newExemplar(internal.NewOrigPtrExemplar(), sharedState)) }) } func TestExemplar_FilteredAttributes(t *testing.T) { diff --git a/pdata/pmetric/generated_exponentialhistogram.go b/pdata/pmetric/generated_exponentialhistogram.go index f83484e978..537455112a 100644 --- a/pdata/pmetric/generated_exponentialhistogram.go +++ b/pdata/pmetric/generated_exponentialhistogram.go @@ -33,7 +33,7 @@ func newExponentialHistogram(orig *otlpmetrics.ExponentialHistogram, state *inte // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExponentialHistogram() ExponentialHistogram { - return newExponentialHistogram(&otlpmetrics.ExponentialHistogram{}, internal.NewState()) + return newExponentialHistogram(internal.NewOrigPtrExponentialHistogram(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_exponentialhistogram_test.go b/pdata/pmetric/generated_exponentialhistogram_test.go index e148840fb7..2908db22d1 100644 --- a/pdata/pmetric/generated_exponentialhistogram_test.go +++ b/pdata/pmetric/generated_exponentialhistogram_test.go @@ -25,8 +25,8 @@ func TestExponentialHistogram_MoveTo(t *testing.T) { assert.Equal(t, generateTestExponentialHistogram(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newExponentialHistogram(&otlpmetrics.ExponentialHistogram{}, sharedState)) }) - assert.Panics(t, func() { newExponentialHistogram(&otlpmetrics.ExponentialHistogram{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newExponentialHistogram(internal.NewOrigPtrExponentialHistogram(), sharedState)) }) + assert.Panics(t, func() { newExponentialHistogram(internal.NewOrigPtrExponentialHistogram(), sharedState).MoveTo(dest) }) } func TestExponentialHistogram_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestExponentialHistogram_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newExponentialHistogram(&otlpmetrics.ExponentialHistogram{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newExponentialHistogram(internal.NewOrigPtrExponentialHistogram(), sharedState)) }) } func TestExponentialHistogram_DataPoints(t *testing.T) { diff --git a/pdata/pmetric/generated_exponentialhistogramdatapoint.go b/pdata/pmetric/generated_exponentialhistogramdatapoint.go index f68cebe521..707d08eb4e 100644 --- a/pdata/pmetric/generated_exponentialhistogramdatapoint.go +++ b/pdata/pmetric/generated_exponentialhistogramdatapoint.go @@ -36,7 +36,7 @@ func newExponentialHistogramDataPoint(orig *otlpmetrics.ExponentialHistogramData // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExponentialHistogramDataPoint() ExponentialHistogramDataPoint { - return newExponentialHistogramDataPoint(&otlpmetrics.ExponentialHistogramDataPoint{}, internal.NewState()) + return newExponentialHistogramDataPoint(internal.NewOrigPtrExponentialHistogramDataPoint(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_exponentialhistogramdatapoint_test.go b/pdata/pmetric/generated_exponentialhistogramdatapoint_test.go index 5bb83be568..ba6d068623 100644 --- a/pdata/pmetric/generated_exponentialhistogramdatapoint_test.go +++ b/pdata/pmetric/generated_exponentialhistogramdatapoint_test.go @@ -27,10 +27,10 @@ func TestExponentialHistogramDataPoint_MoveTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.MoveTo(newExponentialHistogramDataPoint(&otlpmetrics.ExponentialHistogramDataPoint{}, sharedState)) + ms.MoveTo(newExponentialHistogramDataPoint(internal.NewOrigPtrExponentialHistogramDataPoint(), sharedState)) }) assert.Panics(t, func() { - newExponentialHistogramDataPoint(&otlpmetrics.ExponentialHistogramDataPoint{}, sharedState).MoveTo(dest) + newExponentialHistogramDataPoint(internal.NewOrigPtrExponentialHistogramDataPoint(), sharedState).MoveTo(dest) }) } @@ -45,7 +45,7 @@ func TestExponentialHistogramDataPoint_CopyTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.CopyTo(newExponentialHistogramDataPoint(&otlpmetrics.ExponentialHistogramDataPoint{}, sharedState)) + ms.CopyTo(newExponentialHistogramDataPoint(internal.NewOrigPtrExponentialHistogramDataPoint(), sharedState)) }) } diff --git a/pdata/pmetric/generated_exponentialhistogramdatapointbuckets.go b/pdata/pmetric/generated_exponentialhistogramdatapointbuckets.go index 80966f5ca3..4b40f1fe80 100644 --- a/pdata/pmetric/generated_exponentialhistogramdatapointbuckets.go +++ b/pdata/pmetric/generated_exponentialhistogramdatapointbuckets.go @@ -33,7 +33,7 @@ func newExponentialHistogramDataPointBuckets(orig *otlpmetrics.ExponentialHistog // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExponentialHistogramDataPointBuckets() ExponentialHistogramDataPointBuckets { - return newExponentialHistogramDataPointBuckets(&otlpmetrics.ExponentialHistogramDataPoint_Buckets{}, internal.NewState()) + return newExponentialHistogramDataPointBuckets(internal.NewOrigPtrExponentialHistogramDataPoint_Buckets(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_exponentialhistogramdatapointbuckets_test.go b/pdata/pmetric/generated_exponentialhistogramdatapointbuckets_test.go index ff78ff0e60..d717a5a412 100644 --- a/pdata/pmetric/generated_exponentialhistogramdatapointbuckets_test.go +++ b/pdata/pmetric/generated_exponentialhistogramdatapointbuckets_test.go @@ -27,10 +27,10 @@ func TestExponentialHistogramDataPointBuckets_MoveTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.MoveTo(newExponentialHistogramDataPointBuckets(&otlpmetrics.ExponentialHistogramDataPoint_Buckets{}, sharedState)) + ms.MoveTo(newExponentialHistogramDataPointBuckets(internal.NewOrigPtrExponentialHistogramDataPoint_Buckets(), sharedState)) }) assert.Panics(t, func() { - newExponentialHistogramDataPointBuckets(&otlpmetrics.ExponentialHistogramDataPoint_Buckets{}, sharedState).MoveTo(dest) + newExponentialHistogramDataPointBuckets(internal.NewOrigPtrExponentialHistogramDataPoint_Buckets(), sharedState).MoveTo(dest) }) } @@ -45,7 +45,7 @@ func TestExponentialHistogramDataPointBuckets_CopyTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.CopyTo(newExponentialHistogramDataPointBuckets(&otlpmetrics.ExponentialHistogramDataPoint_Buckets{}, sharedState)) + ms.CopyTo(newExponentialHistogramDataPointBuckets(internal.NewOrigPtrExponentialHistogramDataPoint_Buckets(), sharedState)) }) } diff --git a/pdata/pmetric/generated_gauge.go b/pdata/pmetric/generated_gauge.go index ee0e88b07f..35d1f5c503 100644 --- a/pdata/pmetric/generated_gauge.go +++ b/pdata/pmetric/generated_gauge.go @@ -32,7 +32,7 @@ func newGauge(orig *otlpmetrics.Gauge, state *internal.State) Gauge { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewGauge() Gauge { - return newGauge(&otlpmetrics.Gauge{}, internal.NewState()) + return newGauge(internal.NewOrigPtrGauge(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_gauge_test.go b/pdata/pmetric/generated_gauge_test.go index f45154d5dc..9426778827 100644 --- a/pdata/pmetric/generated_gauge_test.go +++ b/pdata/pmetric/generated_gauge_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" ) func TestGauge_MoveTo(t *testing.T) { @@ -25,8 +24,8 @@ func TestGauge_MoveTo(t *testing.T) { assert.Equal(t, generateTestGauge(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newGauge(&otlpmetrics.Gauge{}, sharedState)) }) - assert.Panics(t, func() { newGauge(&otlpmetrics.Gauge{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newGauge(internal.NewOrigPtrGauge(), sharedState)) }) + assert.Panics(t, func() { newGauge(internal.NewOrigPtrGauge(), sharedState).MoveTo(dest) }) } func TestGauge_CopyTo(t *testing.T) { @@ -39,7 +38,7 @@ func TestGauge_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newGauge(&otlpmetrics.Gauge{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newGauge(internal.NewOrigPtrGauge(), sharedState)) }) } func TestGauge_DataPoints(t *testing.T) { diff --git a/pdata/pmetric/generated_histogram.go b/pdata/pmetric/generated_histogram.go index e17be6152c..6a4c837324 100644 --- a/pdata/pmetric/generated_histogram.go +++ b/pdata/pmetric/generated_histogram.go @@ -32,7 +32,7 @@ func newHistogram(orig *otlpmetrics.Histogram, state *internal.State) Histogram // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewHistogram() Histogram { - return newHistogram(&otlpmetrics.Histogram{}, internal.NewState()) + return newHistogram(internal.NewOrigPtrHistogram(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_histogram_test.go b/pdata/pmetric/generated_histogram_test.go index 4e374b1cd0..e1437eaacc 100644 --- a/pdata/pmetric/generated_histogram_test.go +++ b/pdata/pmetric/generated_histogram_test.go @@ -25,8 +25,8 @@ func TestHistogram_MoveTo(t *testing.T) { assert.Equal(t, generateTestHistogram(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newHistogram(&otlpmetrics.Histogram{}, sharedState)) }) - assert.Panics(t, func() { newHistogram(&otlpmetrics.Histogram{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newHistogram(internal.NewOrigPtrHistogram(), sharedState)) }) + assert.Panics(t, func() { newHistogram(internal.NewOrigPtrHistogram(), sharedState).MoveTo(dest) }) } func TestHistogram_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestHistogram_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newHistogram(&otlpmetrics.Histogram{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newHistogram(internal.NewOrigPtrHistogram(), sharedState)) }) } func TestHistogram_DataPoints(t *testing.T) { diff --git a/pdata/pmetric/generated_histogramdatapoint.go b/pdata/pmetric/generated_histogramdatapoint.go index 0205932753..b42799f43f 100644 --- a/pdata/pmetric/generated_histogramdatapoint.go +++ b/pdata/pmetric/generated_histogramdatapoint.go @@ -33,7 +33,7 @@ func newHistogramDataPoint(orig *otlpmetrics.HistogramDataPoint, state *internal // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewHistogramDataPoint() HistogramDataPoint { - return newHistogramDataPoint(&otlpmetrics.HistogramDataPoint{}, internal.NewState()) + return newHistogramDataPoint(internal.NewOrigPtrHistogramDataPoint(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_histogramdatapoint_test.go b/pdata/pmetric/generated_histogramdatapoint_test.go index 17ebdc0ff6..9ccd2492c3 100644 --- a/pdata/pmetric/generated_histogramdatapoint_test.go +++ b/pdata/pmetric/generated_histogramdatapoint_test.go @@ -26,8 +26,8 @@ func TestHistogramDataPoint_MoveTo(t *testing.T) { assert.Equal(t, generateTestHistogramDataPoint(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newHistogramDataPoint(&otlpmetrics.HistogramDataPoint{}, sharedState)) }) - assert.Panics(t, func() { newHistogramDataPoint(&otlpmetrics.HistogramDataPoint{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newHistogramDataPoint(internal.NewOrigPtrHistogramDataPoint(), sharedState)) }) + assert.Panics(t, func() { newHistogramDataPoint(internal.NewOrigPtrHistogramDataPoint(), sharedState).MoveTo(dest) }) } func TestHistogramDataPoint_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestHistogramDataPoint_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newHistogramDataPoint(&otlpmetrics.HistogramDataPoint{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newHistogramDataPoint(internal.NewOrigPtrHistogramDataPoint(), sharedState)) }) } func TestHistogramDataPoint_Attributes(t *testing.T) { diff --git a/pdata/pmetric/generated_metric.go b/pdata/pmetric/generated_metric.go index dcc8010327..ea57d2afeb 100644 --- a/pdata/pmetric/generated_metric.go +++ b/pdata/pmetric/generated_metric.go @@ -34,7 +34,7 @@ func newMetric(orig *otlpmetrics.Metric, state *internal.State) Metric { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewMetric() Metric { - return newMetric(&otlpmetrics.Metric{}, internal.NewState()) + return newMetric(internal.NewOrigPtrMetric(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_metric_test.go b/pdata/pmetric/generated_metric_test.go index d06e0fa84d..79a4bd3e47 100644 --- a/pdata/pmetric/generated_metric_test.go +++ b/pdata/pmetric/generated_metric_test.go @@ -26,8 +26,8 @@ func TestMetric_MoveTo(t *testing.T) { assert.Equal(t, generateTestMetric(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newMetric(&otlpmetrics.Metric{}, sharedState)) }) - assert.Panics(t, func() { newMetric(&otlpmetrics.Metric{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newMetric(internal.NewOrigPtrMetric(), sharedState)) }) + assert.Panics(t, func() { newMetric(internal.NewOrigPtrMetric(), sharedState).MoveTo(dest) }) } func TestMetric_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestMetric_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newMetric(&otlpmetrics.Metric{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newMetric(internal.NewOrigPtrMetric(), sharedState)) }) } func TestMetric_Name(t *testing.T) { diff --git a/pdata/pmetric/generated_metrics.go b/pdata/pmetric/generated_metrics.go index fb4efdb3b0..732bd97826 100644 --- a/pdata/pmetric/generated_metrics.go +++ b/pdata/pmetric/generated_metrics.go @@ -30,7 +30,7 @@ func newMetrics(orig *otlpcollectormetrics.ExportMetricsServiceRequest, state *i // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewMetrics() Metrics { - return newMetrics(&otlpcollectormetrics.ExportMetricsServiceRequest{}, internal.NewState()) + return newMetrics(internal.NewOrigPtrExportMetricsServiceRequest(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_metrics_test.go b/pdata/pmetric/generated_metrics_test.go index a47937bde1..37c2501e7d 100644 --- a/pdata/pmetric/generated_metrics_test.go +++ b/pdata/pmetric/generated_metrics_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" ) func TestMetrics_MoveTo(t *testing.T) { @@ -25,8 +24,8 @@ func TestMetrics_MoveTo(t *testing.T) { assert.Equal(t, generateTestMetrics(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newMetrics(&otlpcollectormetrics.ExportMetricsServiceRequest{}, sharedState)) }) - assert.Panics(t, func() { newMetrics(&otlpcollectormetrics.ExportMetricsServiceRequest{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newMetrics(internal.NewOrigPtrExportMetricsServiceRequest(), sharedState)) }) + assert.Panics(t, func() { newMetrics(internal.NewOrigPtrExportMetricsServiceRequest(), sharedState).MoveTo(dest) }) } func TestMetrics_CopyTo(t *testing.T) { @@ -39,7 +38,7 @@ func TestMetrics_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newMetrics(&otlpcollectormetrics.ExportMetricsServiceRequest{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newMetrics(internal.NewOrigPtrExportMetricsServiceRequest(), sharedState)) }) } func TestMetrics_ResourceMetrics(t *testing.T) { diff --git a/pdata/pmetric/generated_numberdatapoint.go b/pdata/pmetric/generated_numberdatapoint.go index 2d34a13658..fea361cf3c 100644 --- a/pdata/pmetric/generated_numberdatapoint.go +++ b/pdata/pmetric/generated_numberdatapoint.go @@ -33,7 +33,7 @@ func newNumberDataPoint(orig *otlpmetrics.NumberDataPoint, state *internal.State // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewNumberDataPoint() NumberDataPoint { - return newNumberDataPoint(&otlpmetrics.NumberDataPoint{}, internal.NewState()) + return newNumberDataPoint(internal.NewOrigPtrNumberDataPoint(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_numberdatapoint_test.go b/pdata/pmetric/generated_numberdatapoint_test.go index 2d7738f8a9..781bd530fa 100644 --- a/pdata/pmetric/generated_numberdatapoint_test.go +++ b/pdata/pmetric/generated_numberdatapoint_test.go @@ -26,8 +26,8 @@ func TestNumberDataPoint_MoveTo(t *testing.T) { assert.Equal(t, generateTestNumberDataPoint(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newNumberDataPoint(&otlpmetrics.NumberDataPoint{}, sharedState)) }) - assert.Panics(t, func() { newNumberDataPoint(&otlpmetrics.NumberDataPoint{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newNumberDataPoint(internal.NewOrigPtrNumberDataPoint(), sharedState)) }) + assert.Panics(t, func() { newNumberDataPoint(internal.NewOrigPtrNumberDataPoint(), sharedState).MoveTo(dest) }) } func TestNumberDataPoint_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestNumberDataPoint_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newNumberDataPoint(&otlpmetrics.NumberDataPoint{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newNumberDataPoint(internal.NewOrigPtrNumberDataPoint(), sharedState)) }) } func TestNumberDataPoint_Attributes(t *testing.T) { diff --git a/pdata/pmetric/generated_resourcemetrics.go b/pdata/pmetric/generated_resourcemetrics.go index 6301b1bde5..7a4c6cd43b 100644 --- a/pdata/pmetric/generated_resourcemetrics.go +++ b/pdata/pmetric/generated_resourcemetrics.go @@ -33,7 +33,7 @@ func newResourceMetrics(orig *otlpmetrics.ResourceMetrics, state *internal.State // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewResourceMetrics() ResourceMetrics { - return newResourceMetrics(&otlpmetrics.ResourceMetrics{}, internal.NewState()) + return newResourceMetrics(internal.NewOrigPtrResourceMetrics(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_resourcemetrics_test.go b/pdata/pmetric/generated_resourcemetrics_test.go index 947a9b7709..507baf6a93 100644 --- a/pdata/pmetric/generated_resourcemetrics_test.go +++ b/pdata/pmetric/generated_resourcemetrics_test.go @@ -26,8 +26,8 @@ func TestResourceMetrics_MoveTo(t *testing.T) { assert.Equal(t, generateTestResourceMetrics(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newResourceMetrics(&otlpmetrics.ResourceMetrics{}, sharedState)) }) - assert.Panics(t, func() { newResourceMetrics(&otlpmetrics.ResourceMetrics{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newResourceMetrics(internal.NewOrigPtrResourceMetrics(), sharedState)) }) + assert.Panics(t, func() { newResourceMetrics(internal.NewOrigPtrResourceMetrics(), sharedState).MoveTo(dest) }) } func TestResourceMetrics_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestResourceMetrics_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newResourceMetrics(&otlpmetrics.ResourceMetrics{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newResourceMetrics(internal.NewOrigPtrResourceMetrics(), sharedState)) }) } func TestResourceMetrics_Resource(t *testing.T) { diff --git a/pdata/pmetric/generated_scopemetrics.go b/pdata/pmetric/generated_scopemetrics.go index b372c240a3..0652e9c3b0 100644 --- a/pdata/pmetric/generated_scopemetrics.go +++ b/pdata/pmetric/generated_scopemetrics.go @@ -33,7 +33,7 @@ func newScopeMetrics(orig *otlpmetrics.ScopeMetrics, state *internal.State) Scop // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewScopeMetrics() ScopeMetrics { - return newScopeMetrics(&otlpmetrics.ScopeMetrics{}, internal.NewState()) + return newScopeMetrics(internal.NewOrigPtrScopeMetrics(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_scopemetrics_test.go b/pdata/pmetric/generated_scopemetrics_test.go index 0b8a1a0c9f..14e38b4c3a 100644 --- a/pdata/pmetric/generated_scopemetrics_test.go +++ b/pdata/pmetric/generated_scopemetrics_test.go @@ -26,8 +26,8 @@ func TestScopeMetrics_MoveTo(t *testing.T) { assert.Equal(t, generateTestScopeMetrics(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newScopeMetrics(&otlpmetrics.ScopeMetrics{}, sharedState)) }) - assert.Panics(t, func() { newScopeMetrics(&otlpmetrics.ScopeMetrics{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newScopeMetrics(internal.NewOrigPtrScopeMetrics(), sharedState)) }) + assert.Panics(t, func() { newScopeMetrics(internal.NewOrigPtrScopeMetrics(), sharedState).MoveTo(dest) }) } func TestScopeMetrics_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestScopeMetrics_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newScopeMetrics(&otlpmetrics.ScopeMetrics{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newScopeMetrics(internal.NewOrigPtrScopeMetrics(), sharedState)) }) } func TestScopeMetrics_Scope(t *testing.T) { diff --git a/pdata/pmetric/generated_sum.go b/pdata/pmetric/generated_sum.go index 01ae51cea2..4d226a06aa 100644 --- a/pdata/pmetric/generated_sum.go +++ b/pdata/pmetric/generated_sum.go @@ -32,7 +32,7 @@ func newSum(orig *otlpmetrics.Sum, state *internal.State) Sum { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewSum() Sum { - return newSum(&otlpmetrics.Sum{}, internal.NewState()) + return newSum(internal.NewOrigPtrSum(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_sum_test.go b/pdata/pmetric/generated_sum_test.go index 8a93a93c24..f6386247e6 100644 --- a/pdata/pmetric/generated_sum_test.go +++ b/pdata/pmetric/generated_sum_test.go @@ -25,8 +25,8 @@ func TestSum_MoveTo(t *testing.T) { assert.Equal(t, generateTestSum(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newSum(&otlpmetrics.Sum{}, sharedState)) }) - assert.Panics(t, func() { newSum(&otlpmetrics.Sum{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newSum(internal.NewOrigPtrSum(), sharedState)) }) + assert.Panics(t, func() { newSum(internal.NewOrigPtrSum(), sharedState).MoveTo(dest) }) } func TestSum_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestSum_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newSum(&otlpmetrics.Sum{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newSum(internal.NewOrigPtrSum(), sharedState)) }) } func TestSum_DataPoints(t *testing.T) { diff --git a/pdata/pmetric/generated_summary.go b/pdata/pmetric/generated_summary.go index 2a1f6a7d39..6bbbdf1502 100644 --- a/pdata/pmetric/generated_summary.go +++ b/pdata/pmetric/generated_summary.go @@ -32,7 +32,7 @@ func newSummary(orig *otlpmetrics.Summary, state *internal.State) Summary { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewSummary() Summary { - return newSummary(&otlpmetrics.Summary{}, internal.NewState()) + return newSummary(internal.NewOrigPtrSummary(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_summary_test.go b/pdata/pmetric/generated_summary_test.go index b23a7bcc5f..e7246609ae 100644 --- a/pdata/pmetric/generated_summary_test.go +++ b/pdata/pmetric/generated_summary_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpmetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/metrics/v1" ) func TestSummary_MoveTo(t *testing.T) { @@ -25,8 +24,8 @@ func TestSummary_MoveTo(t *testing.T) { assert.Equal(t, generateTestSummary(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newSummary(&otlpmetrics.Summary{}, sharedState)) }) - assert.Panics(t, func() { newSummary(&otlpmetrics.Summary{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newSummary(internal.NewOrigPtrSummary(), sharedState)) }) + assert.Panics(t, func() { newSummary(internal.NewOrigPtrSummary(), sharedState).MoveTo(dest) }) } func TestSummary_CopyTo(t *testing.T) { @@ -39,7 +38,7 @@ func TestSummary_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newSummary(&otlpmetrics.Summary{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newSummary(internal.NewOrigPtrSummary(), sharedState)) }) } func TestSummary_DataPoints(t *testing.T) { diff --git a/pdata/pmetric/generated_summarydatapoint.go b/pdata/pmetric/generated_summarydatapoint.go index 780130326b..823895fe0f 100644 --- a/pdata/pmetric/generated_summarydatapoint.go +++ b/pdata/pmetric/generated_summarydatapoint.go @@ -33,7 +33,7 @@ func newSummaryDataPoint(orig *otlpmetrics.SummaryDataPoint, state *internal.Sta // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewSummaryDataPoint() SummaryDataPoint { - return newSummaryDataPoint(&otlpmetrics.SummaryDataPoint{}, internal.NewState()) + return newSummaryDataPoint(internal.NewOrigPtrSummaryDataPoint(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_summarydatapoint_test.go b/pdata/pmetric/generated_summarydatapoint_test.go index 8845dc5ded..24be84aa1c 100644 --- a/pdata/pmetric/generated_summarydatapoint_test.go +++ b/pdata/pmetric/generated_summarydatapoint_test.go @@ -26,8 +26,8 @@ func TestSummaryDataPoint_MoveTo(t *testing.T) { assert.Equal(t, generateTestSummaryDataPoint(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newSummaryDataPoint(&otlpmetrics.SummaryDataPoint{}, sharedState)) }) - assert.Panics(t, func() { newSummaryDataPoint(&otlpmetrics.SummaryDataPoint{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newSummaryDataPoint(internal.NewOrigPtrSummaryDataPoint(), sharedState)) }) + assert.Panics(t, func() { newSummaryDataPoint(internal.NewOrigPtrSummaryDataPoint(), sharedState).MoveTo(dest) }) } func TestSummaryDataPoint_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestSummaryDataPoint_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newSummaryDataPoint(&otlpmetrics.SummaryDataPoint{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newSummaryDataPoint(internal.NewOrigPtrSummaryDataPoint(), sharedState)) }) } func TestSummaryDataPoint_Attributes(t *testing.T) { diff --git a/pdata/pmetric/generated_summarydatapointvalueatquantile.go b/pdata/pmetric/generated_summarydatapointvalueatquantile.go index f3efbde759..64b171ac12 100644 --- a/pdata/pmetric/generated_summarydatapointvalueatquantile.go +++ b/pdata/pmetric/generated_summarydatapointvalueatquantile.go @@ -32,7 +32,7 @@ func newSummaryDataPointValueAtQuantile(orig *otlpmetrics.SummaryDataPoint_Value // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewSummaryDataPointValueAtQuantile() SummaryDataPointValueAtQuantile { - return newSummaryDataPointValueAtQuantile(&otlpmetrics.SummaryDataPoint_ValueAtQuantile{}, internal.NewState()) + return newSummaryDataPointValueAtQuantile(internal.NewOrigPtrSummaryDataPoint_ValueAtQuantile(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/generated_summarydatapointvalueatquantile_test.go b/pdata/pmetric/generated_summarydatapointvalueatquantile_test.go index 385154eaa6..39f2a34d98 100644 --- a/pdata/pmetric/generated_summarydatapointvalueatquantile_test.go +++ b/pdata/pmetric/generated_summarydatapointvalueatquantile_test.go @@ -26,10 +26,10 @@ func TestSummaryDataPointValueAtQuantile_MoveTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.MoveTo(newSummaryDataPointValueAtQuantile(&otlpmetrics.SummaryDataPoint_ValueAtQuantile{}, sharedState)) + ms.MoveTo(newSummaryDataPointValueAtQuantile(internal.NewOrigPtrSummaryDataPoint_ValueAtQuantile(), sharedState)) }) assert.Panics(t, func() { - newSummaryDataPointValueAtQuantile(&otlpmetrics.SummaryDataPoint_ValueAtQuantile{}, sharedState).MoveTo(dest) + newSummaryDataPointValueAtQuantile(internal.NewOrigPtrSummaryDataPoint_ValueAtQuantile(), sharedState).MoveTo(dest) }) } @@ -44,7 +44,7 @@ func TestSummaryDataPointValueAtQuantile_CopyTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.CopyTo(newSummaryDataPointValueAtQuantile(&otlpmetrics.SummaryDataPoint_ValueAtQuantile{}, sharedState)) + ms.CopyTo(newSummaryDataPointValueAtQuantile(internal.NewOrigPtrSummaryDataPoint_ValueAtQuantile(), sharedState)) }) } diff --git a/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess.go b/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess.go index d4525a3aa3..f8ae891adc 100644 --- a/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess.go +++ b/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess.go @@ -32,7 +32,7 @@ func newExportPartialSuccess(orig *otlpcollectormetrics.ExportMetricsPartialSucc // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExportPartialSuccess() ExportPartialSuccess { - return newExportPartialSuccess(&otlpcollectormetrics.ExportMetricsPartialSuccess{}, internal.NewState()) + return newExportPartialSuccess(internal.NewOrigPtrExportMetricsPartialSuccess(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess_test.go b/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess_test.go index fb0735f483..3154ae42f7 100644 --- a/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess_test.go +++ b/pdata/pmetric/pmetricotlp/generated_exportpartialsuccess_test.go @@ -26,10 +26,10 @@ func TestExportPartialSuccess_MoveTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.MoveTo(newExportPartialSuccess(&otlpcollectormetrics.ExportMetricsPartialSuccess{}, sharedState)) + ms.MoveTo(newExportPartialSuccess(internal.NewOrigPtrExportMetricsPartialSuccess(), sharedState)) }) assert.Panics(t, func() { - newExportPartialSuccess(&otlpcollectormetrics.ExportMetricsPartialSuccess{}, sharedState).MoveTo(dest) + newExportPartialSuccess(internal.NewOrigPtrExportMetricsPartialSuccess(), sharedState).MoveTo(dest) }) } @@ -44,7 +44,7 @@ func TestExportPartialSuccess_CopyTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.CopyTo(newExportPartialSuccess(&otlpcollectormetrics.ExportMetricsPartialSuccess{}, sharedState)) + ms.CopyTo(newExportPartialSuccess(internal.NewOrigPtrExportMetricsPartialSuccess(), sharedState)) }) } diff --git a/pdata/pmetric/pmetricotlp/generated_exportresponse.go b/pdata/pmetric/pmetricotlp/generated_exportresponse.go index a83830d50b..d0a49f4526 100644 --- a/pdata/pmetric/pmetricotlp/generated_exportresponse.go +++ b/pdata/pmetric/pmetricotlp/generated_exportresponse.go @@ -32,7 +32,7 @@ func newExportResponse(orig *otlpcollectormetrics.ExportMetricsServiceResponse, // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExportResponse() ExportResponse { - return newExportResponse(&otlpcollectormetrics.ExportMetricsServiceResponse{}, internal.NewState()) + return newExportResponse(internal.NewOrigPtrExportMetricsServiceResponse(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pmetric/pmetricotlp/generated_exportresponse_test.go b/pdata/pmetric/pmetricotlp/generated_exportresponse_test.go index f089f87525..d6eba5dc0e 100644 --- a/pdata/pmetric/pmetricotlp/generated_exportresponse_test.go +++ b/pdata/pmetric/pmetricotlp/generated_exportresponse_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectormetrics "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/metrics/v1" ) func TestExportResponse_MoveTo(t *testing.T) { @@ -25,12 +24,8 @@ func TestExportResponse_MoveTo(t *testing.T) { assert.Equal(t, generateTestExportResponse(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { - ms.MoveTo(newExportResponse(&otlpcollectormetrics.ExportMetricsServiceResponse{}, sharedState)) - }) - assert.Panics(t, func() { - newExportResponse(&otlpcollectormetrics.ExportMetricsServiceResponse{}, sharedState).MoveTo(dest) - }) + assert.Panics(t, func() { ms.MoveTo(newExportResponse(internal.NewOrigPtrExportMetricsServiceResponse(), sharedState)) }) + assert.Panics(t, func() { newExportResponse(internal.NewOrigPtrExportMetricsServiceResponse(), sharedState).MoveTo(dest) }) } func TestExportResponse_CopyTo(t *testing.T) { @@ -43,9 +38,7 @@ func TestExportResponse_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { - ms.CopyTo(newExportResponse(&otlpcollectormetrics.ExportMetricsServiceResponse{}, sharedState)) - }) + assert.Panics(t, func() { ms.CopyTo(newExportResponse(internal.NewOrigPtrExportMetricsServiceResponse(), sharedState)) }) } func TestExportResponse_PartialSuccess(t *testing.T) { diff --git a/pdata/pprofile/generated_attribute.go b/pdata/pprofile/generated_attribute.go index 16ec6ec072..2eba5f5881 100644 --- a/pdata/pprofile/generated_attribute.go +++ b/pdata/pprofile/generated_attribute.go @@ -33,7 +33,7 @@ func newAttribute(orig *otlpcommon.KeyValue, state *internal.State) Attribute { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewAttribute() Attribute { - return newAttribute(&otlpcommon.KeyValue{}, internal.NewState()) + return newAttribute(internal.NewOrigPtrKeyValue(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_attribute_test.go b/pdata/pprofile/generated_attribute_test.go index 019ec3a823..1cf5d8360d 100644 --- a/pdata/pprofile/generated_attribute_test.go +++ b/pdata/pprofile/generated_attribute_test.go @@ -26,8 +26,8 @@ func TestAttribute_MoveTo(t *testing.T) { assert.Equal(t, generateTestAttribute(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newAttribute(&otlpcommon.KeyValue{}, sharedState)) }) - assert.Panics(t, func() { newAttribute(&otlpcommon.KeyValue{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newAttribute(internal.NewOrigPtrKeyValue(), sharedState)) }) + assert.Panics(t, func() { newAttribute(internal.NewOrigPtrKeyValue(), sharedState).MoveTo(dest) }) } func TestAttribute_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestAttribute_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newAttribute(&otlpcommon.KeyValue{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newAttribute(internal.NewOrigPtrKeyValue(), sharedState)) }) } func TestAttribute_Key(t *testing.T) { diff --git a/pdata/pprofile/generated_attributeunit.go b/pdata/pprofile/generated_attributeunit.go index ebc02d5c58..f858949398 100644 --- a/pdata/pprofile/generated_attributeunit.go +++ b/pdata/pprofile/generated_attributeunit.go @@ -32,7 +32,7 @@ func newAttributeUnit(orig *otlpprofiles.AttributeUnit, state *internal.State) A // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewAttributeUnit() AttributeUnit { - return newAttributeUnit(&otlpprofiles.AttributeUnit{}, internal.NewState()) + return newAttributeUnit(internal.NewOrigPtrAttributeUnit(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_attributeunit_test.go b/pdata/pprofile/generated_attributeunit_test.go index 7bf3c7671b..1d95ef9dfd 100644 --- a/pdata/pprofile/generated_attributeunit_test.go +++ b/pdata/pprofile/generated_attributeunit_test.go @@ -25,8 +25,8 @@ func TestAttributeUnit_MoveTo(t *testing.T) { assert.Equal(t, generateTestAttributeUnit(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newAttributeUnit(&otlpprofiles.AttributeUnit{}, sharedState)) }) - assert.Panics(t, func() { newAttributeUnit(&otlpprofiles.AttributeUnit{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newAttributeUnit(internal.NewOrigPtrAttributeUnit(), sharedState)) }) + assert.Panics(t, func() { newAttributeUnit(internal.NewOrigPtrAttributeUnit(), sharedState).MoveTo(dest) }) } func TestAttributeUnit_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestAttributeUnit_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newAttributeUnit(&otlpprofiles.AttributeUnit{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newAttributeUnit(internal.NewOrigPtrAttributeUnit(), sharedState)) }) } func TestAttributeUnit_AttributeKeyStrindex(t *testing.T) { diff --git a/pdata/pprofile/generated_function.go b/pdata/pprofile/generated_function.go index f64d0f7a93..61edff7129 100644 --- a/pdata/pprofile/generated_function.go +++ b/pdata/pprofile/generated_function.go @@ -32,7 +32,7 @@ func newFunction(orig *otlpprofiles.Function, state *internal.State) Function { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewFunction() Function { - return newFunction(&otlpprofiles.Function{}, internal.NewState()) + return newFunction(internal.NewOrigPtrFunction(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_function_test.go b/pdata/pprofile/generated_function_test.go index 517e9eb713..c7d7311b8d 100644 --- a/pdata/pprofile/generated_function_test.go +++ b/pdata/pprofile/generated_function_test.go @@ -25,8 +25,8 @@ func TestFunction_MoveTo(t *testing.T) { assert.Equal(t, generateTestFunction(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newFunction(&otlpprofiles.Function{}, sharedState)) }) - assert.Panics(t, func() { newFunction(&otlpprofiles.Function{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newFunction(internal.NewOrigPtrFunction(), sharedState)) }) + assert.Panics(t, func() { newFunction(internal.NewOrigPtrFunction(), sharedState).MoveTo(dest) }) } func TestFunction_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestFunction_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newFunction(&otlpprofiles.Function{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newFunction(internal.NewOrigPtrFunction(), sharedState)) }) } func TestFunction_NameStrindex(t *testing.T) { diff --git a/pdata/pprofile/generated_line.go b/pdata/pprofile/generated_line.go index 66e703463f..0d89ef88e7 100644 --- a/pdata/pprofile/generated_line.go +++ b/pdata/pprofile/generated_line.go @@ -32,7 +32,7 @@ func newLine(orig *otlpprofiles.Line, state *internal.State) Line { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewLine() Line { - return newLine(&otlpprofiles.Line{}, internal.NewState()) + return newLine(internal.NewOrigPtrLine(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_line_test.go b/pdata/pprofile/generated_line_test.go index a664eafab2..d8a17a08c5 100644 --- a/pdata/pprofile/generated_line_test.go +++ b/pdata/pprofile/generated_line_test.go @@ -25,8 +25,8 @@ func TestLine_MoveTo(t *testing.T) { assert.Equal(t, generateTestLine(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newLine(&otlpprofiles.Line{}, sharedState)) }) - assert.Panics(t, func() { newLine(&otlpprofiles.Line{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newLine(internal.NewOrigPtrLine(), sharedState)) }) + assert.Panics(t, func() { newLine(internal.NewOrigPtrLine(), sharedState).MoveTo(dest) }) } func TestLine_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestLine_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newLine(&otlpprofiles.Line{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newLine(internal.NewOrigPtrLine(), sharedState)) }) } func TestLine_FunctionIndex(t *testing.T) { diff --git a/pdata/pprofile/generated_link.go b/pdata/pprofile/generated_link.go index 6e8420ca5e..d08257eeae 100644 --- a/pdata/pprofile/generated_link.go +++ b/pdata/pprofile/generated_link.go @@ -34,7 +34,7 @@ func newLink(orig *otlpprofiles.Link, state *internal.State) Link { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewLink() Link { - return newLink(&otlpprofiles.Link{}, internal.NewState()) + return newLink(internal.NewOrigPtrLink(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_link_test.go b/pdata/pprofile/generated_link_test.go index 20c541a07d..ea4012e342 100644 --- a/pdata/pprofile/generated_link_test.go +++ b/pdata/pprofile/generated_link_test.go @@ -13,7 +13,6 @@ import ( "go.opentelemetry.io/collector/pdata/internal" "go.opentelemetry.io/collector/pdata/internal/data" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -27,8 +26,8 @@ func TestLink_MoveTo(t *testing.T) { assert.Equal(t, generateTestLink(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newLink(&otlpprofiles.Link{}, sharedState)) }) - assert.Panics(t, func() { newLink(&otlpprofiles.Link{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newLink(internal.NewOrigPtrLink(), sharedState)) }) + assert.Panics(t, func() { newLink(internal.NewOrigPtrLink(), sharedState).MoveTo(dest) }) } func TestLink_CopyTo(t *testing.T) { @@ -41,7 +40,7 @@ func TestLink_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newLink(&otlpprofiles.Link{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newLink(internal.NewOrigPtrLink(), sharedState)) }) } func TestLink_TraceID(t *testing.T) { diff --git a/pdata/pprofile/generated_location.go b/pdata/pprofile/generated_location.go index fdc9d933a2..6d93993af2 100644 --- a/pdata/pprofile/generated_location.go +++ b/pdata/pprofile/generated_location.go @@ -33,7 +33,7 @@ func newLocation(orig *otlpprofiles.Location, state *internal.State) Location { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewLocation() Location { - return newLocation(&otlpprofiles.Location{}, internal.NewState()) + return newLocation(internal.NewOrigPtrLocation(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_location_test.go b/pdata/pprofile/generated_location_test.go index 3427774a9d..eedce7e699 100644 --- a/pdata/pprofile/generated_location_test.go +++ b/pdata/pprofile/generated_location_test.go @@ -26,8 +26,8 @@ func TestLocation_MoveTo(t *testing.T) { assert.Equal(t, generateTestLocation(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newLocation(&otlpprofiles.Location{}, sharedState)) }) - assert.Panics(t, func() { newLocation(&otlpprofiles.Location{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newLocation(internal.NewOrigPtrLocation(), sharedState)) }) + assert.Panics(t, func() { newLocation(internal.NewOrigPtrLocation(), sharedState).MoveTo(dest) }) } func TestLocation_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestLocation_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newLocation(&otlpprofiles.Location{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newLocation(internal.NewOrigPtrLocation(), sharedState)) }) } func TestLocation_MappingIndex(t *testing.T) { diff --git a/pdata/pprofile/generated_mapping.go b/pdata/pprofile/generated_mapping.go index 52a417cee0..71dc22990c 100644 --- a/pdata/pprofile/generated_mapping.go +++ b/pdata/pprofile/generated_mapping.go @@ -33,7 +33,7 @@ func newMapping(orig *otlpprofiles.Mapping, state *internal.State) Mapping { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewMapping() Mapping { - return newMapping(&otlpprofiles.Mapping{}, internal.NewState()) + return newMapping(internal.NewOrigPtrMapping(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_mapping_test.go b/pdata/pprofile/generated_mapping_test.go index 7af79540e3..cedf9e92b7 100644 --- a/pdata/pprofile/generated_mapping_test.go +++ b/pdata/pprofile/generated_mapping_test.go @@ -26,8 +26,8 @@ func TestMapping_MoveTo(t *testing.T) { assert.Equal(t, generateTestMapping(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newMapping(&otlpprofiles.Mapping{}, sharedState)) }) - assert.Panics(t, func() { newMapping(&otlpprofiles.Mapping{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newMapping(internal.NewOrigPtrMapping(), sharedState)) }) + assert.Panics(t, func() { newMapping(internal.NewOrigPtrMapping(), sharedState).MoveTo(dest) }) } func TestMapping_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestMapping_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newMapping(&otlpprofiles.Mapping{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newMapping(internal.NewOrigPtrMapping(), sharedState)) }) } func TestMapping_MemoryStart(t *testing.T) { diff --git a/pdata/pprofile/generated_profile.go b/pdata/pprofile/generated_profile.go index 828f2d939d..1a026e1d15 100644 --- a/pdata/pprofile/generated_profile.go +++ b/pdata/pprofile/generated_profile.go @@ -34,7 +34,7 @@ func newProfile(orig *otlpprofiles.Profile, state *internal.State) Profile { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewProfile() Profile { - return newProfile(&otlpprofiles.Profile{}, internal.NewState()) + return newProfile(internal.NewOrigPtrProfile(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_profile_test.go b/pdata/pprofile/generated_profile_test.go index 201f439504..90e4d14eff 100644 --- a/pdata/pprofile/generated_profile_test.go +++ b/pdata/pprofile/generated_profile_test.go @@ -27,8 +27,8 @@ func TestProfile_MoveTo(t *testing.T) { assert.Equal(t, generateTestProfile(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newProfile(&otlpprofiles.Profile{}, sharedState)) }) - assert.Panics(t, func() { newProfile(&otlpprofiles.Profile{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newProfile(internal.NewOrigPtrProfile(), sharedState)) }) + assert.Panics(t, func() { newProfile(internal.NewOrigPtrProfile(), sharedState).MoveTo(dest) }) } func TestProfile_CopyTo(t *testing.T) { @@ -41,7 +41,7 @@ func TestProfile_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newProfile(&otlpprofiles.Profile{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newProfile(internal.NewOrigPtrProfile(), sharedState)) }) } func TestProfile_SampleType(t *testing.T) { diff --git a/pdata/pprofile/generated_profiles.go b/pdata/pprofile/generated_profiles.go index 8862761e2d..633ce1b8c8 100644 --- a/pdata/pprofile/generated_profiles.go +++ b/pdata/pprofile/generated_profiles.go @@ -30,7 +30,7 @@ func newProfiles(orig *otlpcollectorprofiles.ExportProfilesServiceRequest, state // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewProfiles() Profiles { - return newProfiles(&otlpcollectorprofiles.ExportProfilesServiceRequest{}, internal.NewState()) + return newProfiles(internal.NewOrigPtrExportProfilesServiceRequest(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_profiles_test.go b/pdata/pprofile/generated_profiles_test.go index f657dfb831..c03578cc2f 100644 --- a/pdata/pprofile/generated_profiles_test.go +++ b/pdata/pprofile/generated_profiles_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" ) func TestProfiles_MoveTo(t *testing.T) { @@ -25,8 +24,8 @@ func TestProfiles_MoveTo(t *testing.T) { assert.Equal(t, generateTestProfiles(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newProfiles(&otlpcollectorprofiles.ExportProfilesServiceRequest{}, sharedState)) }) - assert.Panics(t, func() { newProfiles(&otlpcollectorprofiles.ExportProfilesServiceRequest{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newProfiles(internal.NewOrigPtrExportProfilesServiceRequest(), sharedState)) }) + assert.Panics(t, func() { newProfiles(internal.NewOrigPtrExportProfilesServiceRequest(), sharedState).MoveTo(dest) }) } func TestProfiles_CopyTo(t *testing.T) { @@ -39,7 +38,7 @@ func TestProfiles_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newProfiles(&otlpcollectorprofiles.ExportProfilesServiceRequest{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newProfiles(internal.NewOrigPtrExportProfilesServiceRequest(), sharedState)) }) } func TestProfiles_ResourceProfiles(t *testing.T) { diff --git a/pdata/pprofile/generated_profilesdictionary.go b/pdata/pprofile/generated_profilesdictionary.go index c9bac78acc..298daeefca 100644 --- a/pdata/pprofile/generated_profilesdictionary.go +++ b/pdata/pprofile/generated_profilesdictionary.go @@ -33,7 +33,7 @@ func newProfilesDictionary(orig *otlpprofiles.ProfilesDictionary, state *interna // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewProfilesDictionary() ProfilesDictionary { - return newProfilesDictionary(&otlpprofiles.ProfilesDictionary{}, internal.NewState()) + return newProfilesDictionary(internal.NewOrigPtrProfilesDictionary(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_profilesdictionary_test.go b/pdata/pprofile/generated_profilesdictionary_test.go index a38976e6ac..a4ce7002bb 100644 --- a/pdata/pprofile/generated_profilesdictionary_test.go +++ b/pdata/pprofile/generated_profilesdictionary_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/profiles/v1development" "go.opentelemetry.io/collector/pdata/pcommon" ) @@ -26,8 +25,8 @@ func TestProfilesDictionary_MoveTo(t *testing.T) { assert.Equal(t, generateTestProfilesDictionary(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newProfilesDictionary(&otlpprofiles.ProfilesDictionary{}, sharedState)) }) - assert.Panics(t, func() { newProfilesDictionary(&otlpprofiles.ProfilesDictionary{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newProfilesDictionary(internal.NewOrigPtrProfilesDictionary(), sharedState)) }) + assert.Panics(t, func() { newProfilesDictionary(internal.NewOrigPtrProfilesDictionary(), sharedState).MoveTo(dest) }) } func TestProfilesDictionary_CopyTo(t *testing.T) { @@ -40,7 +39,7 @@ func TestProfilesDictionary_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newProfilesDictionary(&otlpprofiles.ProfilesDictionary{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newProfilesDictionary(internal.NewOrigPtrProfilesDictionary(), sharedState)) }) } func TestProfilesDictionary_MappingTable(t *testing.T) { diff --git a/pdata/pprofile/generated_resourceprofiles.go b/pdata/pprofile/generated_resourceprofiles.go index 7b58f40431..f97ec63427 100644 --- a/pdata/pprofile/generated_resourceprofiles.go +++ b/pdata/pprofile/generated_resourceprofiles.go @@ -33,7 +33,7 @@ func newResourceProfiles(orig *otlpprofiles.ResourceProfiles, state *internal.St // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewResourceProfiles() ResourceProfiles { - return newResourceProfiles(&otlpprofiles.ResourceProfiles{}, internal.NewState()) + return newResourceProfiles(internal.NewOrigPtrResourceProfiles(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_resourceprofiles_test.go b/pdata/pprofile/generated_resourceprofiles_test.go index 92eae969c7..b3006fd95a 100644 --- a/pdata/pprofile/generated_resourceprofiles_test.go +++ b/pdata/pprofile/generated_resourceprofiles_test.go @@ -26,8 +26,8 @@ func TestResourceProfiles_MoveTo(t *testing.T) { assert.Equal(t, generateTestResourceProfiles(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newResourceProfiles(&otlpprofiles.ResourceProfiles{}, sharedState)) }) - assert.Panics(t, func() { newResourceProfiles(&otlpprofiles.ResourceProfiles{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newResourceProfiles(internal.NewOrigPtrResourceProfiles(), sharedState)) }) + assert.Panics(t, func() { newResourceProfiles(internal.NewOrigPtrResourceProfiles(), sharedState).MoveTo(dest) }) } func TestResourceProfiles_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestResourceProfiles_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newResourceProfiles(&otlpprofiles.ResourceProfiles{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newResourceProfiles(internal.NewOrigPtrResourceProfiles(), sharedState)) }) } func TestResourceProfiles_Resource(t *testing.T) { diff --git a/pdata/pprofile/generated_sample.go b/pdata/pprofile/generated_sample.go index 1a75355a4b..b4f312b89e 100644 --- a/pdata/pprofile/generated_sample.go +++ b/pdata/pprofile/generated_sample.go @@ -33,7 +33,7 @@ func newSample(orig *otlpprofiles.Sample, state *internal.State) Sample { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewSample() Sample { - return newSample(&otlpprofiles.Sample{}, internal.NewState()) + return newSample(internal.NewOrigPtrSample(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_sample_test.go b/pdata/pprofile/generated_sample_test.go index 1c4de2597e..ad988770a2 100644 --- a/pdata/pprofile/generated_sample_test.go +++ b/pdata/pprofile/generated_sample_test.go @@ -26,8 +26,8 @@ func TestSample_MoveTo(t *testing.T) { assert.Equal(t, generateTestSample(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newSample(&otlpprofiles.Sample{}, sharedState)) }) - assert.Panics(t, func() { newSample(&otlpprofiles.Sample{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newSample(internal.NewOrigPtrSample(), sharedState)) }) + assert.Panics(t, func() { newSample(internal.NewOrigPtrSample(), sharedState).MoveTo(dest) }) } func TestSample_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestSample_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newSample(&otlpprofiles.Sample{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newSample(internal.NewOrigPtrSample(), sharedState)) }) } func TestSample_LocationsStartIndex(t *testing.T) { diff --git a/pdata/pprofile/generated_scopeprofiles.go b/pdata/pprofile/generated_scopeprofiles.go index 80bf80aaec..961eb1b66f 100644 --- a/pdata/pprofile/generated_scopeprofiles.go +++ b/pdata/pprofile/generated_scopeprofiles.go @@ -33,7 +33,7 @@ func newScopeProfiles(orig *otlpprofiles.ScopeProfiles, state *internal.State) S // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewScopeProfiles() ScopeProfiles { - return newScopeProfiles(&otlpprofiles.ScopeProfiles{}, internal.NewState()) + return newScopeProfiles(internal.NewOrigPtrScopeProfiles(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_scopeprofiles_test.go b/pdata/pprofile/generated_scopeprofiles_test.go index aeec75ba57..b0496965d9 100644 --- a/pdata/pprofile/generated_scopeprofiles_test.go +++ b/pdata/pprofile/generated_scopeprofiles_test.go @@ -26,8 +26,8 @@ func TestScopeProfiles_MoveTo(t *testing.T) { assert.Equal(t, generateTestScopeProfiles(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newScopeProfiles(&otlpprofiles.ScopeProfiles{}, sharedState)) }) - assert.Panics(t, func() { newScopeProfiles(&otlpprofiles.ScopeProfiles{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newScopeProfiles(internal.NewOrigPtrScopeProfiles(), sharedState)) }) + assert.Panics(t, func() { newScopeProfiles(internal.NewOrigPtrScopeProfiles(), sharedState).MoveTo(dest) }) } func TestScopeProfiles_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestScopeProfiles_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newScopeProfiles(&otlpprofiles.ScopeProfiles{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newScopeProfiles(internal.NewOrigPtrScopeProfiles(), sharedState)) }) } func TestScopeProfiles_Scope(t *testing.T) { diff --git a/pdata/pprofile/generated_valuetype.go b/pdata/pprofile/generated_valuetype.go index 76159be910..2a7642e74f 100644 --- a/pdata/pprofile/generated_valuetype.go +++ b/pdata/pprofile/generated_valuetype.go @@ -32,7 +32,7 @@ func newValueType(orig *otlpprofiles.ValueType, state *internal.State) ValueType // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewValueType() ValueType { - return newValueType(&otlpprofiles.ValueType{}, internal.NewState()) + return newValueType(internal.NewOrigPtrValueType(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/generated_valuetype_test.go b/pdata/pprofile/generated_valuetype_test.go index 7c8b1eafbb..2a22f80d0e 100644 --- a/pdata/pprofile/generated_valuetype_test.go +++ b/pdata/pprofile/generated_valuetype_test.go @@ -25,8 +25,8 @@ func TestValueType_MoveTo(t *testing.T) { assert.Equal(t, generateTestValueType(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newValueType(&otlpprofiles.ValueType{}, sharedState)) }) - assert.Panics(t, func() { newValueType(&otlpprofiles.ValueType{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newValueType(internal.NewOrigPtrValueType(), sharedState)) }) + assert.Panics(t, func() { newValueType(internal.NewOrigPtrValueType(), sharedState).MoveTo(dest) }) } func TestValueType_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestValueType_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newValueType(&otlpprofiles.ValueType{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newValueType(internal.NewOrigPtrValueType(), sharedState)) }) } func TestValueType_TypeStrindex(t *testing.T) { diff --git a/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go b/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go index 2a220583f0..9eae053cdf 100644 --- a/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go +++ b/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess.go @@ -32,7 +32,7 @@ func newExportPartialSuccess(orig *otlpcollectorprofiles.ExportProfilesPartialSu // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExportPartialSuccess() ExportPartialSuccess { - return newExportPartialSuccess(&otlpcollectorprofiles.ExportProfilesPartialSuccess{}, internal.NewState()) + return newExportPartialSuccess(internal.NewOrigPtrExportProfilesPartialSuccess(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess_test.go b/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess_test.go index 6f912f19b7..a73d22d704 100644 --- a/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess_test.go +++ b/pdata/pprofile/pprofileotlp/generated_exportpartialsuccess_test.go @@ -26,10 +26,10 @@ func TestExportPartialSuccess_MoveTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.MoveTo(newExportPartialSuccess(&otlpcollectorprofiles.ExportProfilesPartialSuccess{}, sharedState)) + ms.MoveTo(newExportPartialSuccess(internal.NewOrigPtrExportProfilesPartialSuccess(), sharedState)) }) assert.Panics(t, func() { - newExportPartialSuccess(&otlpcollectorprofiles.ExportProfilesPartialSuccess{}, sharedState).MoveTo(dest) + newExportPartialSuccess(internal.NewOrigPtrExportProfilesPartialSuccess(), sharedState).MoveTo(dest) }) } @@ -44,7 +44,7 @@ func TestExportPartialSuccess_CopyTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.CopyTo(newExportPartialSuccess(&otlpcollectorprofiles.ExportProfilesPartialSuccess{}, sharedState)) + ms.CopyTo(newExportPartialSuccess(internal.NewOrigPtrExportProfilesPartialSuccess(), sharedState)) }) } diff --git a/pdata/pprofile/pprofileotlp/generated_exportresponse.go b/pdata/pprofile/pprofileotlp/generated_exportresponse.go index bd28f5cf9a..721b78feb9 100644 --- a/pdata/pprofile/pprofileotlp/generated_exportresponse.go +++ b/pdata/pprofile/pprofileotlp/generated_exportresponse.go @@ -32,7 +32,7 @@ func newExportResponse(orig *otlpcollectorprofiles.ExportProfilesServiceResponse // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExportResponse() ExportResponse { - return newExportResponse(&otlpcollectorprofiles.ExportProfilesServiceResponse{}, internal.NewState()) + return newExportResponse(internal.NewOrigPtrExportProfilesServiceResponse(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/pprofile/pprofileotlp/generated_exportresponse_test.go b/pdata/pprofile/pprofileotlp/generated_exportresponse_test.go index b1599f2599..9ca23483e7 100644 --- a/pdata/pprofile/pprofileotlp/generated_exportresponse_test.go +++ b/pdata/pprofile/pprofileotlp/generated_exportresponse_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectorprofiles "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/profiles/v1development" ) func TestExportResponse_MoveTo(t *testing.T) { @@ -25,11 +24,9 @@ func TestExportResponse_MoveTo(t *testing.T) { assert.Equal(t, generateTestExportResponse(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() + assert.Panics(t, func() { ms.MoveTo(newExportResponse(internal.NewOrigPtrExportProfilesServiceResponse(), sharedState)) }) assert.Panics(t, func() { - ms.MoveTo(newExportResponse(&otlpcollectorprofiles.ExportProfilesServiceResponse{}, sharedState)) - }) - assert.Panics(t, func() { - newExportResponse(&otlpcollectorprofiles.ExportProfilesServiceResponse{}, sharedState).MoveTo(dest) + newExportResponse(internal.NewOrigPtrExportProfilesServiceResponse(), sharedState).MoveTo(dest) }) } @@ -43,9 +40,7 @@ func TestExportResponse_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { - ms.CopyTo(newExportResponse(&otlpcollectorprofiles.ExportProfilesServiceResponse{}, sharedState)) - }) + assert.Panics(t, func() { ms.CopyTo(newExportResponse(internal.NewOrigPtrExportProfilesServiceResponse(), sharedState)) }) } func TestExportResponse_PartialSuccess(t *testing.T) { diff --git a/pdata/ptrace/generated_resourcespans.go b/pdata/ptrace/generated_resourcespans.go index f056c8fb0e..752d2dadf4 100644 --- a/pdata/ptrace/generated_resourcespans.go +++ b/pdata/ptrace/generated_resourcespans.go @@ -33,7 +33,7 @@ func newResourceSpans(orig *otlptrace.ResourceSpans, state *internal.State) Reso // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewResourceSpans() ResourceSpans { - return newResourceSpans(&otlptrace.ResourceSpans{}, internal.NewState()) + return newResourceSpans(internal.NewOrigPtrResourceSpans(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/generated_resourcespans_test.go b/pdata/ptrace/generated_resourcespans_test.go index 2be891879e..11e93646b7 100644 --- a/pdata/ptrace/generated_resourcespans_test.go +++ b/pdata/ptrace/generated_resourcespans_test.go @@ -26,8 +26,8 @@ func TestResourceSpans_MoveTo(t *testing.T) { assert.Equal(t, generateTestResourceSpans(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newResourceSpans(&otlptrace.ResourceSpans{}, sharedState)) }) - assert.Panics(t, func() { newResourceSpans(&otlptrace.ResourceSpans{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newResourceSpans(internal.NewOrigPtrResourceSpans(), sharedState)) }) + assert.Panics(t, func() { newResourceSpans(internal.NewOrigPtrResourceSpans(), sharedState).MoveTo(dest) }) } func TestResourceSpans_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestResourceSpans_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newResourceSpans(&otlptrace.ResourceSpans{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newResourceSpans(internal.NewOrigPtrResourceSpans(), sharedState)) }) } func TestResourceSpans_Resource(t *testing.T) { diff --git a/pdata/ptrace/generated_scopespans.go b/pdata/ptrace/generated_scopespans.go index 3fc3ac8eea..03188d2ed0 100644 --- a/pdata/ptrace/generated_scopespans.go +++ b/pdata/ptrace/generated_scopespans.go @@ -33,7 +33,7 @@ func newScopeSpans(orig *otlptrace.ScopeSpans, state *internal.State) ScopeSpans // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewScopeSpans() ScopeSpans { - return newScopeSpans(&otlptrace.ScopeSpans{}, internal.NewState()) + return newScopeSpans(internal.NewOrigPtrScopeSpans(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/generated_scopespans_test.go b/pdata/ptrace/generated_scopespans_test.go index e3776ca9a0..e4377f13bb 100644 --- a/pdata/ptrace/generated_scopespans_test.go +++ b/pdata/ptrace/generated_scopespans_test.go @@ -26,8 +26,8 @@ func TestScopeSpans_MoveTo(t *testing.T) { assert.Equal(t, generateTestScopeSpans(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newScopeSpans(&otlptrace.ScopeSpans{}, sharedState)) }) - assert.Panics(t, func() { newScopeSpans(&otlptrace.ScopeSpans{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newScopeSpans(internal.NewOrigPtrScopeSpans(), sharedState)) }) + assert.Panics(t, func() { newScopeSpans(internal.NewOrigPtrScopeSpans(), sharedState).MoveTo(dest) }) } func TestScopeSpans_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestScopeSpans_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newScopeSpans(&otlptrace.ScopeSpans{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newScopeSpans(internal.NewOrigPtrScopeSpans(), sharedState)) }) } func TestScopeSpans_Scope(t *testing.T) { diff --git a/pdata/ptrace/generated_span.go b/pdata/ptrace/generated_span.go index a14a7e6acf..01635cbe98 100644 --- a/pdata/ptrace/generated_span.go +++ b/pdata/ptrace/generated_span.go @@ -35,7 +35,7 @@ func newSpan(orig *otlptrace.Span, state *internal.State) Span { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewSpan() Span { - return newSpan(&otlptrace.Span{}, internal.NewState()) + return newSpan(internal.NewOrigPtrSpan(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/generated_span_test.go b/pdata/ptrace/generated_span_test.go index e71027eb33..6248e69014 100644 --- a/pdata/ptrace/generated_span_test.go +++ b/pdata/ptrace/generated_span_test.go @@ -27,8 +27,8 @@ func TestSpan_MoveTo(t *testing.T) { assert.Equal(t, generateTestSpan(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newSpan(&otlptrace.Span{}, sharedState)) }) - assert.Panics(t, func() { newSpan(&otlptrace.Span{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newSpan(internal.NewOrigPtrSpan(), sharedState)) }) + assert.Panics(t, func() { newSpan(internal.NewOrigPtrSpan(), sharedState).MoveTo(dest) }) } func TestSpan_CopyTo(t *testing.T) { @@ -41,7 +41,7 @@ func TestSpan_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newSpan(&otlptrace.Span{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newSpan(internal.NewOrigPtrSpan(), sharedState)) }) } func TestSpan_TraceID(t *testing.T) { diff --git a/pdata/ptrace/generated_spanevent.go b/pdata/ptrace/generated_spanevent.go index b9fed03846..a57f9b761a 100644 --- a/pdata/ptrace/generated_spanevent.go +++ b/pdata/ptrace/generated_spanevent.go @@ -34,7 +34,7 @@ func newSpanEvent(orig *otlptrace.Span_Event, state *internal.State) SpanEvent { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewSpanEvent() SpanEvent { - return newSpanEvent(&otlptrace.Span_Event{}, internal.NewState()) + return newSpanEvent(internal.NewOrigPtrSpan_Event(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/generated_spanevent_test.go b/pdata/ptrace/generated_spanevent_test.go index 6f4ecfcb2e..a24761e09e 100644 --- a/pdata/ptrace/generated_spanevent_test.go +++ b/pdata/ptrace/generated_spanevent_test.go @@ -26,8 +26,8 @@ func TestSpanEvent_MoveTo(t *testing.T) { assert.Equal(t, generateTestSpanEvent(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newSpanEvent(&otlptrace.Span_Event{}, sharedState)) }) - assert.Panics(t, func() { newSpanEvent(&otlptrace.Span_Event{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newSpanEvent(internal.NewOrigPtrSpan_Event(), sharedState)) }) + assert.Panics(t, func() { newSpanEvent(internal.NewOrigPtrSpan_Event(), sharedState).MoveTo(dest) }) } func TestSpanEvent_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestSpanEvent_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newSpanEvent(&otlptrace.Span_Event{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newSpanEvent(internal.NewOrigPtrSpan_Event(), sharedState)) }) } func TestSpanEvent_Timestamp(t *testing.T) { diff --git a/pdata/ptrace/generated_spanlink.go b/pdata/ptrace/generated_spanlink.go index b2780a8137..009c842c33 100644 --- a/pdata/ptrace/generated_spanlink.go +++ b/pdata/ptrace/generated_spanlink.go @@ -36,7 +36,7 @@ func newSpanLink(orig *otlptrace.Span_Link, state *internal.State) SpanLink { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewSpanLink() SpanLink { - return newSpanLink(&otlptrace.Span_Link{}, internal.NewState()) + return newSpanLink(internal.NewOrigPtrSpan_Link(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/generated_spanlink_test.go b/pdata/ptrace/generated_spanlink_test.go index cf1d9b63e4..0ad88557d6 100644 --- a/pdata/ptrace/generated_spanlink_test.go +++ b/pdata/ptrace/generated_spanlink_test.go @@ -27,8 +27,8 @@ func TestSpanLink_MoveTo(t *testing.T) { assert.Equal(t, generateTestSpanLink(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newSpanLink(&otlptrace.Span_Link{}, sharedState)) }) - assert.Panics(t, func() { newSpanLink(&otlptrace.Span_Link{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newSpanLink(internal.NewOrigPtrSpan_Link(), sharedState)) }) + assert.Panics(t, func() { newSpanLink(internal.NewOrigPtrSpan_Link(), sharedState).MoveTo(dest) }) } func TestSpanLink_CopyTo(t *testing.T) { @@ -41,7 +41,7 @@ func TestSpanLink_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newSpanLink(&otlptrace.Span_Link{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newSpanLink(internal.NewOrigPtrSpan_Link(), sharedState)) }) } func TestSpanLink_TraceID(t *testing.T) { diff --git a/pdata/ptrace/generated_status.go b/pdata/ptrace/generated_status.go index ede3d2f545..3e8720494d 100644 --- a/pdata/ptrace/generated_status.go +++ b/pdata/ptrace/generated_status.go @@ -33,7 +33,7 @@ func newStatus(orig *otlptrace.Status, state *internal.State) Status { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewStatus() Status { - return newStatus(&otlptrace.Status{}, internal.NewState()) + return newStatus(internal.NewOrigPtrStatus(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/generated_status_test.go b/pdata/ptrace/generated_status_test.go index 7ab23772b5..4fecedf52a 100644 --- a/pdata/ptrace/generated_status_test.go +++ b/pdata/ptrace/generated_status_test.go @@ -25,8 +25,8 @@ func TestStatus_MoveTo(t *testing.T) { assert.Equal(t, generateTestStatus(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newStatus(&otlptrace.Status{}, sharedState)) }) - assert.Panics(t, func() { newStatus(&otlptrace.Status{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newStatus(internal.NewOrigPtrStatus(), sharedState)) }) + assert.Panics(t, func() { newStatus(internal.NewOrigPtrStatus(), sharedState).MoveTo(dest) }) } func TestStatus_CopyTo(t *testing.T) { @@ -39,7 +39,7 @@ func TestStatus_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newStatus(&otlptrace.Status{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newStatus(internal.NewOrigPtrStatus(), sharedState)) }) } func TestStatus_Message(t *testing.T) { diff --git a/pdata/ptrace/generated_traces.go b/pdata/ptrace/generated_traces.go index 715efd8b94..5328e57ce5 100644 --- a/pdata/ptrace/generated_traces.go +++ b/pdata/ptrace/generated_traces.go @@ -30,7 +30,7 @@ func newTraces(orig *otlpcollectortrace.ExportTraceServiceRequest, state *intern // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewTraces() Traces { - return newTraces(&otlpcollectortrace.ExportTraceServiceRequest{}, internal.NewState()) + return newTraces(internal.NewOrigPtrExportTraceServiceRequest(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/generated_traces_test.go b/pdata/ptrace/generated_traces_test.go index 7687d16272..b386310dbb 100644 --- a/pdata/ptrace/generated_traces_test.go +++ b/pdata/ptrace/generated_traces_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1" ) func TestTraces_MoveTo(t *testing.T) { @@ -25,8 +24,8 @@ func TestTraces_MoveTo(t *testing.T) { assert.Equal(t, generateTestTraces(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newTraces(&otlpcollectortrace.ExportTraceServiceRequest{}, sharedState)) }) - assert.Panics(t, func() { newTraces(&otlpcollectortrace.ExportTraceServiceRequest{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newTraces(internal.NewOrigPtrExportTraceServiceRequest(), sharedState)) }) + assert.Panics(t, func() { newTraces(internal.NewOrigPtrExportTraceServiceRequest(), sharedState).MoveTo(dest) }) } func TestTraces_CopyTo(t *testing.T) { @@ -39,7 +38,7 @@ func TestTraces_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newTraces(&otlpcollectortrace.ExportTraceServiceRequest{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newTraces(internal.NewOrigPtrExportTraceServiceRequest(), sharedState)) }) } func TestTraces_ResourceSpans(t *testing.T) { diff --git a/pdata/ptrace/ptraceotlp/generated_exportpartialsuccess.go b/pdata/ptrace/ptraceotlp/generated_exportpartialsuccess.go index 21778b488b..dad6da7c32 100644 --- a/pdata/ptrace/ptraceotlp/generated_exportpartialsuccess.go +++ b/pdata/ptrace/ptraceotlp/generated_exportpartialsuccess.go @@ -32,7 +32,7 @@ func newExportPartialSuccess(orig *otlpcollectortrace.ExportTracePartialSuccess, // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExportPartialSuccess() ExportPartialSuccess { - return newExportPartialSuccess(&otlpcollectortrace.ExportTracePartialSuccess{}, internal.NewState()) + return newExportPartialSuccess(internal.NewOrigPtrExportTracePartialSuccess(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/ptraceotlp/generated_exportpartialsuccess_test.go b/pdata/ptrace/ptraceotlp/generated_exportpartialsuccess_test.go index 73c3aa4980..e454540b09 100644 --- a/pdata/ptrace/ptraceotlp/generated_exportpartialsuccess_test.go +++ b/pdata/ptrace/ptraceotlp/generated_exportpartialsuccess_test.go @@ -26,10 +26,10 @@ func TestExportPartialSuccess_MoveTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.MoveTo(newExportPartialSuccess(&otlpcollectortrace.ExportTracePartialSuccess{}, sharedState)) + ms.MoveTo(newExportPartialSuccess(internal.NewOrigPtrExportTracePartialSuccess(), sharedState)) }) assert.Panics(t, func() { - newExportPartialSuccess(&otlpcollectortrace.ExportTracePartialSuccess{}, sharedState).MoveTo(dest) + newExportPartialSuccess(internal.NewOrigPtrExportTracePartialSuccess(), sharedState).MoveTo(dest) }) } @@ -44,7 +44,7 @@ func TestExportPartialSuccess_CopyTo(t *testing.T) { sharedState := internal.NewState() sharedState.MarkReadOnly() assert.Panics(t, func() { - ms.CopyTo(newExportPartialSuccess(&otlpcollectortrace.ExportTracePartialSuccess{}, sharedState)) + ms.CopyTo(newExportPartialSuccess(internal.NewOrigPtrExportTracePartialSuccess(), sharedState)) }) } diff --git a/pdata/ptrace/ptraceotlp/generated_exportresponse.go b/pdata/ptrace/ptraceotlp/generated_exportresponse.go index ddf258ed3d..2b6c3e7014 100644 --- a/pdata/ptrace/ptraceotlp/generated_exportresponse.go +++ b/pdata/ptrace/ptraceotlp/generated_exportresponse.go @@ -32,7 +32,7 @@ func newExportResponse(orig *otlpcollectortrace.ExportTraceServiceResponse, stat // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewExportResponse() ExportResponse { - return newExportResponse(&otlpcollectortrace.ExportTraceServiceResponse{}, internal.NewState()) + return newExportResponse(internal.NewOrigPtrExportTraceServiceResponse(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/ptrace/ptraceotlp/generated_exportresponse_test.go b/pdata/ptrace/ptraceotlp/generated_exportresponse_test.go index 445931fb66..5ab561b037 100644 --- a/pdata/ptrace/ptraceotlp/generated_exportresponse_test.go +++ b/pdata/ptrace/ptraceotlp/generated_exportresponse_test.go @@ -12,7 +12,6 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/pdata/internal" - otlpcollectortrace "go.opentelemetry.io/collector/pdata/internal/data/protogen/collector/trace/v1" ) func TestExportResponse_MoveTo(t *testing.T) { @@ -25,8 +24,8 @@ func TestExportResponse_MoveTo(t *testing.T) { assert.Equal(t, generateTestExportResponse(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newExportResponse(&otlpcollectortrace.ExportTraceServiceResponse{}, sharedState)) }) - assert.Panics(t, func() { newExportResponse(&otlpcollectortrace.ExportTraceServiceResponse{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newExportResponse(internal.NewOrigPtrExportTraceServiceResponse(), sharedState)) }) + assert.Panics(t, func() { newExportResponse(internal.NewOrigPtrExportTraceServiceResponse(), sharedState).MoveTo(dest) }) } func TestExportResponse_CopyTo(t *testing.T) { @@ -39,7 +38,7 @@ func TestExportResponse_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newExportResponse(&otlpcollectortrace.ExportTraceServiceResponse{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newExportResponse(internal.NewOrigPtrExportTraceServiceResponse(), sharedState)) }) } func TestExportResponse_PartialSuccess(t *testing.T) { diff --git a/pdata/xpdata/entity/generated_entityref.go b/pdata/xpdata/entity/generated_entityref.go index 779bdab5e9..424114be57 100644 --- a/pdata/xpdata/entity/generated_entityref.go +++ b/pdata/xpdata/entity/generated_entityref.go @@ -28,7 +28,7 @@ func newEntityRef(orig *otlpcommon.EntityRef, state *internal.State) EntityRef { // This must be used only in testing code. Users should use "AppendEmpty" when part of a Slice, // OR directly access the member if this is embedded in another struct. func NewEntityRef() EntityRef { - return newEntityRef(&otlpcommon.EntityRef{}, internal.NewState()) + return newEntityRef(internal.NewOrigPtrEntityRef(), internal.NewState()) } // MoveTo moves all properties from the current struct overriding the destination and diff --git a/pdata/xpdata/entity/generated_entityref_test.go b/pdata/xpdata/entity/generated_entityref_test.go index 5043cb481a..1291da6a83 100644 --- a/pdata/xpdata/entity/generated_entityref_test.go +++ b/pdata/xpdata/entity/generated_entityref_test.go @@ -26,8 +26,8 @@ func TestEntityRef_MoveTo(t *testing.T) { assert.Equal(t, generateTestEntityRef(), dest) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.MoveTo(newEntityRef(&otlpcommon.EntityRef{}, sharedState)) }) - assert.Panics(t, func() { newEntityRef(&otlpcommon.EntityRef{}, sharedState).MoveTo(dest) }) + assert.Panics(t, func() { ms.MoveTo(newEntityRef(internal.NewOrigPtrEntityRef(), sharedState)) }) + assert.Panics(t, func() { newEntityRef(internal.NewOrigPtrEntityRef(), sharedState).MoveTo(dest) }) } func TestEntityRef_CopyTo(t *testing.T) { @@ -40,7 +40,7 @@ func TestEntityRef_CopyTo(t *testing.T) { assert.Equal(t, orig, ms) sharedState := internal.NewState() sharedState.MarkReadOnly() - assert.Panics(t, func() { ms.CopyTo(newEntityRef(&otlpcommon.EntityRef{}, sharedState)) }) + assert.Panics(t, func() { ms.CopyTo(newEntityRef(internal.NewOrigPtrEntityRef(), sharedState)) }) } func TestEntityRef_SchemaUrl(t *testing.T) {