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

ioutil in unmarshal error

This commit is contained in:
Tyschitskaya Maria 2022-01-27 14:56:47 +03:00
parent cd6859b074
commit f24f4d512e
2 changed files with 3 additions and 2 deletions

View File

@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
go-version: ['1.11', '1.12', '1.13', '1.14', '1.15', '1.16', '1.17'] go-version: ['1.13', '1.14', '1.15', '1.16', '1.17']
steps: steps:
- name: Set up Go ${{ matrix.go-version }} - name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2 uses: actions/setup-go@v2

View File

@ -5,6 +5,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"io/ioutil"
) )
var ErrUnmarshal = errors.New("unmarshal error") var ErrUnmarshal = errors.New("unmarshal error")
@ -15,7 +16,7 @@ type UnmarshalError struct {
} }
func (u *UnmarshalError) Error() string { func (u *UnmarshalError) Error() string {
content, err := io.ReadAll(u.Content) content, err := ioutil.ReadAll(u.Content)
if err != nil { if err != nil {
content = []byte("[can not read content]") content = []byte("[can not read content]")
} }