aboutsummaryrefslogtreecommitdiffstats
path: root/asspb_test.go
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2025-10-27 18:00:36 -0700
committerRose Hogenson <rosehogenson@posteo.net>2025-10-27 18:00:36 -0700
commit470d207390e5aa250fe7f50037fee1c6bf8aace9 (patch)
tree3c3e62cf74a4c33dbddc8dfb8ff4f0074f80127d /asspb_test.go
parentUse struct reflection instead of relying on JSON (diff)
downloadccl-470d207390e5aa250fe7f50037fee1c6bf8aace9.tar.zst
Build the field map only once
Diffstat (limited to 'asspb_test.go')
-rw-r--r--asspb_test.go20
1 files changed, 10 insertions, 10 deletions
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 **/ {}`,