From 0ce1d3e727ea347c3588f96be8a356fa6ea3bc0e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Fri, 10 Feb 2023 19:58:52 -0700 Subject: tree-wide: Update various references from Go 1.18 to Go 1.20 --- README.md | 18 +++++++++--------- compat/json/README.md | 12 ++++++------ decode.go | 2 +- encode.go | 2 +- internal/jsonstruct/struct.go | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 108f3dc..4ef4038 100644 --- a/README.md +++ b/README.md @@ -141,17 +141,17 @@ These are streaming variants of the standard `json.Unmarshaler` and [`lowmemjson`]: https://pkg.go.dev/git.lukeshu.com/go/lowmemjson [`lowmemjson/compat/json`]: https://pkg.go.dev/git.lukeshu.com/go/lowmemjson/compat/json -[`encoding/json`]: https://pkg.go.dev/encoding/json@go1.18 +[`encoding/json`]: https://pkg.go.dev/encoding/json@go1.20 -[`json.Marshaler`]: https://pkg.go.dev/encoding/json@go1.18#Marshaler -[`json.Unmarshaler`]: https://pkg.go.dev/encoding/json@go1.18#Unmarshaler -[`json.Marshal`]: https://pkg.go.dev/encoding/json@go1.18#Marshal -[`json.Unmarshal`]: https://pkg.go.dev/encoding/json@go1.18#Unmarshal -[`json.Compact`]: https://pkg.go.dev/encoding/json@go1.18#Compact -[`json.HTMLEscape`]: https://pkg.go.dev/encoding/json@go1.18#HTMLEscape -[`json.Indent`]: https://pkg.go.dev/encoding/json@go1.18#Indent -[`json.Valid`]: https://pkg.go.dev/encoding/json@go1.18#Valid +[`json.Marshaler`]: https://pkg.go.dev/encoding/json@go1.20#Marshaler +[`json.Unmarshaler`]: https://pkg.go.dev/encoding/json@go1.20#Unmarshaler +[`json.Marshal`]: https://pkg.go.dev/encoding/json@go1.20#Marshal +[`json.Unmarshal`]: https://pkg.go.dev/encoding/json@go1.20#Unmarshal +[`json.Compact`]: https://pkg.go.dev/encoding/json@go1.20#Compact +[`json.HTMLEscape`]: https://pkg.go.dev/encoding/json@go1.20#HTMLEscape +[`json.Indent`]: https://pkg.go.dev/encoding/json@go1.20#Indent +[`json.Valid`]: https://pkg.go.dev/encoding/json@go1.20#Valid [`lowmemjson.Encodable`]: https://pkg.go.dev/git.lukeshu.com/go/lowmemjson#Encodable diff --git a/compat/json/README.md b/compat/json/README.md index ec8dbed..531b87e 100644 --- a/compat/json/README.md +++ b/compat/json/README.md @@ -50,11 +50,11 @@ Types that are deprecated in `encoding/json` are not mimiced here: [`lowmemjson`]: https://pkg.go.dev/git.lukeshu.com/go/lowmemjson -[`encoding/json`]: https://pkg.go.dev/encoding/json@go1.18 +[`encoding/json`]: https://pkg.go.dev/encoding/json@go1.20 -[`Delim`]: https://pkg.go.dev/encoding/json@go1.18#Delim -[`Token`]: https://pkg.go.dev/encoding/json@go1.18#Token -[`Decoder.Token`]: https://pkg.go.dev/encoding/json@go1.18#Decoder.Token -[`InvalidUTF8Error`]: https://pkg.go.dev/encoding/json@go1.18#InvalidUTF8Error -[`UnmarshalFieldError`]: https://pkg.go.dev/encoding/json@go1.18#UnmarshalFieldError +[`Delim`]: https://pkg.go.dev/encoding/json@go1.20#Delim +[`Token`]: https://pkg.go.dev/encoding/json@go1.20#Token +[`Decoder.Token`]: https://pkg.go.dev/encoding/json@go1.20#Decoder.Token +[`InvalidUTF8Error`]: https://pkg.go.dev/encoding/json@go1.20#InvalidUTF8Error +[`UnmarshalFieldError`]: https://pkg.go.dev/encoding/json@go1.20#UnmarshalFieldError diff --git a/decode.go b/decode.go index 487bce4..1b6bdf2 100644 --- a/decode.go +++ b/decode.go @@ -232,7 +232,7 @@ func (dec *Decoder) DecodeThenEOF(ptr any) (err error) { // json.Unmarshaler interface it also checks for the Decodable // interface. // -// [documentation for encoding/json.Unmarshal]: https://pkg.go.dev/encoding/json@go1.18#Unmarshal +// [documentation for encoding/json.Unmarshal]: https://pkg.go.dev/encoding/json@go1.20#Unmarshal func (dec *Decoder) Decode(ptr any) (err error) { ptrVal := reflect.ValueOf(ptr) if ptrVal.Kind() != reflect.Pointer || ptrVal.IsNil() || !ptrVal.Elem().CanSet() { diff --git a/encode.go b/encode.go index 2d16891..2830ace 100644 --- a/encode.go +++ b/encode.go @@ -78,7 +78,7 @@ func NewEncoder(w io.Writer) *Encoder { // may write partial output, whereas encodin/json would not have // written anything. // -// [documentation for encoding/json.Marshal]: https://pkg.go.dev/encoding/json@go1.18#Marshal +// [documentation for encoding/json.Marshal]: https://pkg.go.dev/encoding/json@go1.20#Marshal func (enc *Encoder) Encode(obj any) (err error) { if enc.isRoot { enc.w.par.Reset() diff --git a/internal/jsonstruct/struct.go b/internal/jsonstruct/struct.go index 16c45de..20e82ca 100644 --- a/internal/jsonstruct/struct.go +++ b/internal/jsonstruct/struct.go @@ -63,7 +63,7 @@ func indexStructReal(typ reflect.Type) StructIndex { ret.ByName[name] = len(ret.ByPos) ret.ByPos = append(ret.ByPos, _field) default: - // To quote the encoding/json docs (version 1.18.4): + // To quote the encoding/json docs (version 1.20): // // If there are multiple fields at the same level, and that level is the // least nested (and would therefore be the nesting level selected by the -- cgit v1.1-4-g5e80