1
0
mirror of https://github.com/golang/go synced 2024-11-18 11:14:39 -07:00

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 <hyangah@gmail.com>
Reviewed-by: Robert Findley <rfindley@google.com>
This commit is contained in:
Hana (Hyang-Ah) Kim 2020-04-06 17:06:51 -04:00 committed by Hyang-Ah Hana Kim
parent 1fd976651f
commit 066fd1390e

View File

@ -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)
}