mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-03-29 21:47:00 +02:00
refactor: use Key's Defined method (#2593)
* optimize(attribute): use Key's Defined method * Update kv.go
This commit is contained in:
parent
010ca4f2b1
commit
b01dc21f6c
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user