From 888d8383abbfaabb848c568c03d282e7728492cf Mon Sep 17 00:00:00 2001 From: Wojciech Kaczmarek Date: Thu, 14 Sep 2023 19:47:36 +0200 Subject: [PATCH] reflect: allow anonymous struct --- reflect.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reflect.go b/reflect.go index 366354b..8dd6acf 100644 --- a/reflect.go +++ b/reflect.go @@ -31,7 +31,7 @@ func appendBlocks(dest any, blocks []Block) error { func copyBlock(v reflect.Value, block *Block) error { t := v.Type() - if st, bt := t.Name(), block.Type; !unsnakeEq(st, bt) { + if st, bt := t.Name(), block.Type; st != "" && !unsnakeEq(st, bt) { return StructErr( fmt.Sprintf("mismatch: struct type %s, block type %s", st, bt), )