From 7f5ea51dc81904ff31c7f08e615c5e2119f20f4b Mon Sep 17 00:00:00 2001 From: Isaac Schwabacher <59542438+ijschwabacher@users.noreply.github.com> Date: Mon, 11 May 2020 19:01:54 -0400 Subject: [PATCH] Fix a confusing error message. Because `in` is a []byte, as written this prints a list of integers instead of the unrecognized enum value. --- jsonpb/decode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jsonpb/decode.go b/jsonpb/decode.go index 857383025b..7c6c5a5244 100644 --- a/jsonpb/decode.go +++ b/jsonpb/decode.go @@ -474,7 +474,7 @@ func (u *Unmarshaler) unmarshalSingularValue(v protoreflect.Value, in []byte, fd if hasPrefixAndSuffix('"', in, '"') { vd := fd.Enum().Values().ByName(protoreflect.Name(trimQuote(in))) if vd == nil { - return v, fmt.Errorf("unknown value %v for enum %s", in, fd.Enum().FullName()) + return v, fmt.Errorf("unknown value %q for enum %s", in, fd.Enum().FullName()) } return protoreflect.ValueOfEnum(vd.Number()), nil }