Skip to content

Commit

Permalink
refactor: use Key's Defined method (#2593)
Browse files Browse the repository at this point in the history
* optimize(attribute): use Key's Defined method

* Update kv.go
  • Loading branch information
1046102779 committed Feb 11, 2022
1 parent 010ca4f commit b01dc21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion attribute/kv.go
Expand Up @@ -26,7 +26,7 @@ type KeyValue struct {

// Valid returns if kv is a valid OpenTelemetry attribute.
func (kv KeyValue) Valid() bool {
return kv.Key != "" && kv.Value.Type() != INVALID
return kv.Key.Defined() && kv.Value.Type() != INVALID
}

// Bool creates a KeyValue with a BOOL Value type.
Expand Down

0 comments on commit b01dc21

Please sign in to comment.