Skip to content

Commit

Permalink
feat: remove unsafe.Slice in om to support go1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Dec 15, 2023
1 parent 26d0593 commit b821c32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion om/conv.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (r hashConv) FromHash(fields map[string]string) error {
continue
}
if f.conv.StringToValue == nil {
if err := json.Unmarshal(unsafe.Slice(unsafe.StringData(v), len(v)), r.entity.Field(f.idx).Addr().Interface()); err != nil {
if err := json.Unmarshal([]byte(v), r.entity.Field(f.idx).Addr().Interface()); err != nil {
return err
}
} else {
Expand Down

0 comments on commit b821c32

Please sign in to comment.