1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-27 22:49:15 +02:00

change key to a string alias and KeyValue constructors (#217)

* change key to a string alias and KeyValue constructors

* fix int and uint tests
This commit is contained in:
Gustavo Silva Paiva
2019-10-17 02:49:58 -03:00
committed by rghetia
parent 75562dd381
commit 5e409de1aa
15 changed files with 288 additions and 102 deletions

View File

@@ -5,9 +5,7 @@ import (
"unsafe"
)
type Key struct {
Name string
}
type Key string
type KeyValue struct {
Key Key
@@ -147,7 +145,7 @@ func (k Key) Uint(v uint) KeyValue {
}
func (k Key) Defined() bool {
return len(k.Name) != 0
return len(k) != 0
}
// TODO make this a lazy one-time conversion.