Removed dependency on xerrors

This commit is contained in:
Masaaki Goshima 2020-05-09 01:49:37 +09:00
parent aae63769a1
commit e562358cdf
3 changed files with 1 additions and 7 deletions

View file

@ -8,8 +8,6 @@ import (
"strings"
"sync"
"unsafe"
"golang.org/x/xerrors"
)
// A Token holds a value of one of these types:
@ -222,7 +220,7 @@ func (d *Decoder) compile(typ *rtype) (decoder, error) {
case reflect.Float64:
return d.compileFloat64()
}
return nil, xerrors.Errorf("unknown type %s", typ)
return nil, &UnsupportedTypeError{Type: rtype2type(typ)}
}
func (d *Decoder) compilePtr(typ *rtype) (decoder, error) {

2
go.mod
View file

@ -1,5 +1,3 @@
module github.com/goccy/go-json
go 1.12
require golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543

2
go.sum
View file

@ -1,2 +0,0 @@
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=