1
0
mirror of synced 2024-11-22 04:46:05 +03:00

json error text tests fix

This commit is contained in:
Tyschitskaya Maria 2022-01-28 12:28:24 +03:00
parent 76d0d601a0
commit d0069e73f8

View File

@ -4,6 +4,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"io/ioutil"
) )
var ErrUnmarshal = errors.New("unmarshal error") var ErrUnmarshal = errors.New("unmarshal error")
@ -30,7 +31,7 @@ func NewUnmarshalError(err error) *UnmarshalError {
} }
func (u *UnmarshalError) WithReader(reader io.Reader) *UnmarshalError { func (u *UnmarshalError) WithReader(reader io.Reader) *UnmarshalError {
content, _ := io.ReadAll(reader) content, _ := ioutil.ReadAll(reader)
u.Content = content u.Content = content
return u return u
} }