Skip to content

Commit

Permalink
nolint
Browse files Browse the repository at this point in the history
  • Loading branch information
svyotov committed Jan 12, 2020
1 parent 590d6ed commit 612279b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,16 @@ func deepMerge(dstIn, src reflect.Value, visited map[uintptr]*visit, depth int,
for i, n := 0, dst.NumField(); i < n; i++ {
dstField := dst.Field(i)
structField := dst.Type().Field(i)
// copy un-exported struct fields
if !isExportedComponent(&structField) {
rf := dstCp.Field(i)
rf = reflect.NewAt(rf.Type(), unsafe.Pointer(rf.UnsafeAddr())).Elem() // no:gosec

rf = reflect.NewAt(rf.Type(), unsafe.Pointer(rf.Pointer())).Elem() //nolint:gosec
dstRF := dst.Field(i)
if !dst.Field(i).CanAddr() {
continue
}

dstRF = reflect.NewAt(dstRF.Type(), unsafe.Pointer(dstRF.UnsafeAddr())).Elem() // no:gosec

dstRF = reflect.NewAt(dstRF.Type(), unsafe.Pointer(dstRF.UnsafeAddr())).Elem() //nolint:gosec
rf.Set(dstRF)
continue
}
Expand Down

0 comments on commit 612279b

Please sign in to comment.