summaryrefslogtreecommitdiff
path: root/vendor/github.com/opentracing/opentracing-go/log/util.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-02 08:41:52 -0400
committerGitHub <noreply@github.com>2020-07-02 08:41:52 -0400
commitc131567401bea2867d597d79cce75b99012e64fb (patch)
tree43f7df15bc69affe6482f14f9250a79322847d46 /vendor/github.com/opentracing/opentracing-go/log/util.go
parent9fb0b56f584fe45ca264433319bddb542e7ec953 (diff)
parentc4248e62ca8721aaed1fba241a822e201327317d (diff)
downloadpodman-c131567401bea2867d597d79cce75b99012e64fb.tar.gz
podman-c131567401bea2867d597d79cce75b99012e64fb.tar.bz2
podman-c131567401bea2867d597d79cce75b99012e64fb.zip
Merge pull request #6840 from containers/dependabot/go_modules/github.com/opentracing/opentracing-go-1.2.0
Bump github.com/opentracing/opentracing-go from 1.1.0 to 1.2.0
Diffstat (limited to 'vendor/github.com/opentracing/opentracing-go/log/util.go')
-rw-r--r--vendor/github.com/opentracing/opentracing-go/log/util.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/github.com/opentracing/opentracing-go/log/util.go b/vendor/github.com/opentracing/opentracing-go/log/util.go
index 3832feb5c..d57e28aa5 100644
--- a/vendor/github.com/opentracing/opentracing-go/log/util.go
+++ b/vendor/github.com/opentracing/opentracing-go/log/util.go
@@ -1,6 +1,9 @@
package log
-import "fmt"
+import (
+ "fmt"
+ "reflect"
+)
// InterleavedKVToFields converts keyValues a la Span.LogKV() to a Field slice
// a la Span.LogFields().
@@ -46,6 +49,10 @@ func InterleavedKVToFields(keyValues ...interface{}) ([]Field, error) {
case float64:
fields[i] = Float64(key, typedVal)
default:
+ if typedVal == nil || (reflect.ValueOf(typedVal).Kind() == reflect.Ptr && reflect.ValueOf(typedVal).IsNil()) {
+ fields[i] = String(key, "nil")
+ continue
+ }
// When in doubt, coerce to a string
fields[i] = String(key, fmt.Sprint(typedVal))
}