Skip to content

Commit

Permalink
Merge pull request #15 from m-mizutani/mizutani/fix-interface-handler
Browse files Browse the repository at this point in the history
Handle interface type properly in clone method
  • Loading branch information
m-mizutani authored Feb 19, 2024
2 parents a839a28 + 33947c4 commit ccdd4ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ func (x *masq) clone(fieldName string, src reflect.Value, tag string) reflect.Va
dst.Elem().Set(copied)
return dst

case reflect.Interface:
return x.clone(fieldName, src.Elem(), tag)

default:
dst := reflect.New(src.Type())
dst.Elem().Set(src)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/m-mizutani/masq

go 1.21
go 1.22

require github.com/m-mizutani/gt v0.0.7

Expand Down

0 comments on commit ccdd4ed

Please sign in to comment.