From 470d207390e5aa250fe7f50037fee1c6bf8aace9 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Mon, 27 Oct 2025 18:00:36 -0700 Subject: Build the field map only once --- asspb_test.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'asspb_test.go') diff --git a/asspb_test.go b/asspb_test.go index 7deb8f3..bda34bf 100644 --- a/asspb_test.go +++ b/asspb_test.go @@ -13,15 +13,15 @@ func TestUnmarshal(t *testing.T) { Field int64 `ccl:"field"` } type message struct { - String string `ccl:"string"` - String2 string `ccl:"string2"` - Int int64 `ccl:"int"` - Float float64 `ccl:"float"` - Bool bool `ccl:"bool"` - Bool2 bool `ccl:"bool2"` - Message *nestedMessage `ccl:"message"` - Repeated []int64 `ccl:"repeated"` - RepeatedMessage []nestedMessage `ccl:"repeated_message"` + String string `ccl:"string"` + String2 string `ccl:"string2"` + Int int64 `ccl:"int"` + Float float64 `ccl:"float"` + Bool bool `ccl:"bool"` + Bool2 bool `ccl:"bool2"` + Message *nestedMessage `ccl:"message"` + Repeated []int64 `ccl:"repeated"` + RepeatedMessage []*nestedMessage `ccl:"repeated_message"` Ignore map[int]int `ccl:"-,"` // unlike JSON this also means ignore unexported int64 @@ -212,7 +212,7 @@ can just span multiple lines"`, }, { desc: "ListOfMessage", msg: `repeated_message: [{}]`, - want: message{RepeatedMessage: []nestedMessage{{}}}, + want: message{RepeatedMessage: []*nestedMessage{{}}}, }, { desc: "CStyleComment", msg: `message: /** inline comment **/ {}`, -- cgit v1.3.1