1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-16 02:47:20 +02:00

Check marshalled value instead of iface (#1299)

* Check marshalled value

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

* Update CHANGELOG.md

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

* Move change to Fixed section

Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Daniil Rutskiy 2020-11-02 19:27:41 +03:00 committed by GitHub
parent 238d2c015c
commit 911d7be43d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -47,6 +47,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Fixed
- The `go.opentelemetry.io/otel/api/global` packages global TextMapPropagator now delegates functionality to a globally set delegate for all previously returned propagators. (#1258)
- Fix condition in `label.Any`. (#1299)
## [0.13.0] - 2020-10-08

View File

@ -137,7 +137,7 @@ func Any(k string, value interface{}) KeyValue {
case reflect.String:
return String(k, rv.String())
}
if b, err := json.Marshal(value); value != nil && err == nil {
if b, err := json.Marshal(value); b != nil && err == nil {
return String(k, string(b))
}
return String(k, fmt.Sprint(value))