From 7b7814916ba97db95b3f66413b601fa5cdff0e23 Mon Sep 17 00:00:00 2001 From: Jeff Hodges Date: Thu, 4 Jan 2024 03:00:54 -0800 Subject: [PATCH] internal/impl: correct reflect.ValueError use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The composites x/tools/analysis pass errors on this use of reflect.ValueError with: ``` internal/impl/message_reflect_field.go:541:10: reflect.ValueError struct literal uses unkeyed fields (composites) ``` This patch adds the missing field names. Change-Id: I1a175aad6e9724c27f2469adc1f3a9b1e8c61e85 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/553915 Reviewed-by: Christian Höppner Reviewed-by: Michael Stapelberg Auto-Submit: Michael Stapelberg LUCI-TryBot-Result: Go LUCI --- internal/impl/message_reflect_field.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/impl/message_reflect_field.go b/internal/impl/message_reflect_field.go index 5e736c60..986322b1 100644 --- a/internal/impl/message_reflect_field.go +++ b/internal/impl/message_reflect_field.go @@ -538,6 +538,6 @@ func isZero(v reflect.Value) bool { } return true default: - panic(&reflect.ValueError{"reflect.Value.IsZero", v.Kind()}) + panic(&reflect.ValueError{Method: "reflect.Value.IsZero", Kind: v.Kind()}) } }