Skip to content

Commit

Permalink
reflect: allow anonymous struct
Browse files Browse the repository at this point in the history
  • Loading branch information
wkhere committed Sep 14, 2023
1 parent 44820ee commit 888d838
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
Expand Down

0 comments on commit 888d838

Please sign in to comment.