ioutil in unmarshal error
This commit is contained in:
parent
cd6859b074
commit
f24f4d512e
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -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
|
||||||
|
@ -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]")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user