Skip to content

Commit

Permalink
fix: copy bytes in mapModel.Scan (#1030) (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
bnonce authored Oct 26, 2024
1 parent 8638613 commit 39fda4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion model_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ func (m *mapModel) Scan(src interface{}) error {
return m.scanRaw(src)
case reflect.Slice:
if scanType.Elem().Kind() == reflect.Uint8 {
return m.scanRaw(src)
srcB := src.([]byte)
src2 := make([]byte, len(srcB))
copy(src2, srcB)

return m.scanRaw(src2)
}
}

Expand Down

0 comments on commit 39fda4e

Please sign in to comment.