Skip to content

Commit f42dc5c

Browse files
author
Morgan Pittkin
committed
remove commented-out line
1 parent c6a4703 commit f42dc5c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

copier.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ func copier(toValue interface{}, fromValue interface{}, opt Option) (err error)
139139
return ErrInvalidCopyFrom
140140
}
141141

142-
// If possible, simply copy the struct
143-
//if from.Type().AssignableTo(to.Type()) && to.Kind() == reflect.Interface {
142+
// If the target is an empty interface with value nil, simply copy the value
144143
if from.Kind() == reflect.Struct && from.Type().AssignableTo(to.Type()) && reflect.TypeOf(to.Interface()) == nil {
145144
to.Set(from)
146145
return

0 commit comments

Comments
 (0)