Skip to content

Commit

Permalink
Mark as deprecated NewAttributeValue (open-telemetry#2022)
Browse files Browse the repository at this point in the history
Remove usages from non generated call. It is strange to have two new functions that do the same thing.

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Oct 28, 2020
1 parent a3fa0a9 commit 371514c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion consumer/pdata/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -101,6 +101,7 @@ func NewAttributeValueNull() AttributeValue {
return AttributeValue{orig: &orig}
}

// Deprecated: Use NewAttributeValueNull()
func NewAttributeValue() AttributeValue {
return NewAttributeValueNull()
}
Expand Down
2 changes: 1 addition & 1 deletion translator/trace/protospan_translation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func TestAttributeValueToString(t *testing.T) {
},
{
name: "array",
input: pdata.NewAttributeValue(),
input: pdata.NewAttributeValueNull(),
jsonLike: false,
expected: "",
},
Expand Down

0 comments on commit 371514c

Please sign in to comment.