From 371514c38447c2bb949ad19e3cd10176ce255d22 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Wed, 28 Oct 2020 15:12:15 -0700 Subject: [PATCH] Mark as deprecated NewAttributeValue (#2022) Remove usages from non generated call. It is strange to have two new functions that do the same thing. Signed-off-by: Bogdan Drutu --- consumer/pdata/common.go | 3 ++- translator/trace/protospan_translation_test.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/consumer/pdata/common.go b/consumer/pdata/common.go index f208113b2cf..6ea5e10ff00 100644 --- a/consumer/pdata/common.go +++ b/consumer/pdata/common.go @@ -66,7 +66,7 @@ func (avt AttributeValueType) String() string { } // AttributeValue represents a value of an attribute. Typically used in AttributeMap. -// Must use one of NewAttributeValue* functions below to create new instances. +// Must use one of NewAttributeValue+ functions below to create new instances. // // Intended to be passed by value since internally it is just a pointer to actual // value representation. For the same reason passing by value and calling setters @@ -101,6 +101,7 @@ func NewAttributeValueNull() AttributeValue { return AttributeValue{orig: &orig} } +// Deprecated: Use NewAttributeValueNull() func NewAttributeValue() AttributeValue { return NewAttributeValueNull() } diff --git a/translator/trace/protospan_translation_test.go b/translator/trace/protospan_translation_test.go index 11d96f8a53c..a3d04ffa8c8 100644 --- a/translator/trace/protospan_translation_test.go +++ b/translator/trace/protospan_translation_test.go @@ -85,7 +85,7 @@ func TestAttributeValueToString(t *testing.T) { }, { name: "array", - input: pdata.NewAttributeValue(), + input: pdata.NewAttributeValueNull(), jsonLike: false, expected: "", },