From e562358cdff3ed3df904da7e1a462f77b292ef5a Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Sat, 9 May 2020 01:49:37 +0900 Subject: [PATCH] Removed dependency on xerrors --- decode.go | 4 +--- go.mod | 2 -- go.sum | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/decode.go b/decode.go index 4b746d7..3208329 100644 --- a/decode.go +++ b/decode.go @@ -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) { diff --git a/go.mod b/go.mod index 0a800ea..58a1488 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,3 @@ module github.com/goccy/go-json go 1.12 - -require golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 diff --git a/go.sum b/go.sum index 3ab73ea..e69de29 100644 --- a/go.sum +++ b/go.sum @@ -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=