Skip to content

Commit

Permalink
Update Go and dependencies (#10)
Browse files Browse the repository at this point in the history
- Update to Go 1.19 in go.mod
- Remove pkg/errors, use %w
- Update golang.org/x/tools
  • Loading branch information
axw authored Jun 12, 2023
1 parent d0f3759 commit 70549d9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ methods for all exported types within a specified package.

## Requirements

Go 1.8+
Go 1.19+

## License

Expand Down
7 changes: 2 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module go.elastic.co/fastjson

go 1.14
go 1.19

require (
github.com/pkg/errors v0.8.0
golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5
)
require golang.org/x/tools v0.9.3
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand All @@ -16,6 +14,8 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5 h1:MeC2gMlMdkd67dn17MEby3rGXRxZtWeiRXOnISfTQ74=
golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.9.3 h1:Gn1I8+64MsuTb/HpH+LmQtNas23LhUVr3rYZ0eKuaMM=
golang.org/x/tools v0.9.3/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
Expand Down
6 changes: 2 additions & 4 deletions marshaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ package fastjson
import (
"encoding/json"
"fmt"

"github.com/pkg/errors"
)

// Marshaler defines an interface that types can implement to provide
Expand Down Expand Up @@ -59,7 +57,7 @@ type Appender interface {
// panics due to a broken json.Marshaler implementation or assumption, then
// Marshal will encode the panic as
//
// {"__PANIC__": "panic calling MarshalJSON for type Foo: reason"}
// {"__PANIC__": "panic calling MarshalJSON for type Foo: reason"}
//
// Marshal returns the first error encountered.
func Marshal(w *Writer, v interface{}) error {
Expand Down Expand Up @@ -133,7 +131,7 @@ func marshalReflect(w *Writer, v interface{}) (result error) {
if !ok {
err = fmt.Errorf("%s", r)
}
result = errors.Wrapf(err, "panic calling MarshalJSON for type %T", v)
result = fmt.Errorf("panic calling MarshalJSON for type %T: %w", v, err)
w.RawString(`{"__PANIC__":`)
w.String(fmt.Sprint(result))
w.RawByte('}')
Expand Down

0 comments on commit 70549d9

Please sign in to comment.