Skip to content

Commit a39dcdf

Browse files
committed
fix
1 parent 02235df commit a39dcdf

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

components/scrubber/scrubber.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ func (s *scrubberImpl) deepCopyStruct(fieldName string, src reflect.Value, scrub
222222
)
223223
switch scrubTag {
224224
case "ignore":
225-
return dst
225+
dst.Elem().SetString(src.String())
226+
if !dst.CanInterface() {
227+
return dst
228+
}
229+
return dst.Elem()
226230
case "hash":
227231
setExplicitValue = true
228232
explicitValue = SanitiseHash(src.String())
@@ -313,6 +317,12 @@ func (s *scrubberImpl) deepCopyStruct(fieldName string, src reflect.Value, scrub
313317
}
314318
return dst
315319

320+
case reflect.Interface:
321+
dst := reflect.New(src.Elem().Type())
322+
copied := s.deepCopyStruct(fieldName, src.Elem(), scrubTag, skipScrub)
323+
dst.Elem().Set(copied)
324+
return dst.Elem()
325+
316326
case reflect.Ptr:
317327
dst := reflect.New(src.Elem().Type())
318328
copied := s.deepCopyStruct(fieldName, src.Elem(), scrubTag, skipScrub)

0 commit comments

Comments
 (0)