diff --git a/copier.go b/copier.go index 43a14f1..0cc6465 100644 --- a/copier.go +++ b/copier.go @@ -232,6 +232,11 @@ func copier(toValue interface{}, fromValue interface{}, opt Option) (err error) } } } + + if to.Len() > from.Len() { + to.SetLen(from.Len()) + } + return } }