diff --git a/src/context/context.go b/src/context/context.go index 77298f6531..ad67d2301d 100644 --- a/src/context/context.go +++ b/src/context/context.go @@ -497,10 +497,10 @@ type valueCtx struct { // want context depending on the unicode tables. This is only used by // *valueCtx.String(). func stringify(v interface{}) string { - if s, ok := v.(stringer); ok { + switch s := v.(type) { + case stringer: return s.String() - } - if s, ok := v.(string); ok { + case string: return s } return ""