We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 440c5e0 commit 2d13b4dCopy full SHA for 2d13b4d
om/json.go
@@ -67,7 +67,7 @@ func (r *JSONRepository[T]) FetchCache(ctx context.Context, id string, ttl time.
67
68
func (r *JSONRepository[T]) decode(record string) (*T, error) {
69
var v T
70
- if err := json.NewDecoder(strings.NewReader(record)).Decode(&v); err != nil {
+ if err := json.Unmarshal([]byte(record), &v); err != nil {
71
return nil, err
72
}
73
return &v, nil
0 commit comments