From 066fd1390ee0526e4b0a2855752efb3ea41a6648 Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Mon, 6 Apr 2020 17:06:51 -0400 Subject: [PATCH] internal/telemetry/event: fix error/value key type tag formatting %v behaves better with nil values. Change-Id: I4041f5460173c8f420553996d64d9463ef5a0370 Reviewed-on: https://go-review.googlesource.com/c/tools/+/227355 Run-TryBot: Hyang-Ah Hana Kim Reviewed-by: Robert Findley --- internal/telemetry/event/tag.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/telemetry/event/tag.go b/internal/telemetry/event/tag.go index 7d7a34c0f6..e3c81eb4b2 100644 --- a/internal/telemetry/event/tag.go +++ b/internal/telemetry/event/tag.go @@ -106,9 +106,9 @@ func (t Tag) Format(f fmt.State, r rune) { case *StringKey: fmt.Fprintf(f, "%s=%q", key.Name(), key.From(t)) case *ErrorKey: - fmt.Fprintf(f, "%s=%q", key.Name(), key.From(t)) + fmt.Fprintf(f, "%s=%v", key.Name(), key.From(t)) case *ValueKey: - fmt.Fprintf(f, "%s=%q", key.Name(), key.From(t)) + fmt.Fprintf(f, "%s=%v", key.Name(), key.From(t)) default: fmt.Fprintf(f, `%s="invalid type %T"`, key.Name(), key) }