From f86331b872bbe1df9d59a96d92663728fab6bd29 Mon Sep 17 00:00:00 2001 From: Geoffrey Date: Thu, 2 Jul 2026 18:33:39 +0000 Subject: [PATCH] go: upgrade to Go 1.26.4 and run go fix ./... --- go.mod | 2 +- jsonschemadoc.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index d3d26de..dc94659 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/sourcegraph/jsonschemadoc -go 1.14 +go 1.26.4 require ( github.com/pkg/errors v0.9.1 // indirect diff --git a/jsonschemadoc.go b/jsonschemadoc.go index 303a928..09cd6a2 100644 --- a/jsonschemadoc.go +++ b/jsonschemadoc.go @@ -113,7 +113,7 @@ func Generate(schema *jsonschema.Schema) (string, error) { return buf.String(), nil } -func marshalIndentIfLong(v interface{}, prefix, indent string) ([]byte, error) { +func marshalIndentIfLong(v any, prefix, indent string) ([]byte, error) { const longChars = 30 b, err := json.Marshal(v) if len(b) > longChars { @@ -138,7 +138,7 @@ func writeJSONComment(buf *bytes.Buffer, indent, space, text string) error { return nil } -func writeJSONValue(enc *json.Encoder, buf *bytes.Buffer, v interface{}) error { +func writeJSONValue(enc *json.Encoder, buf *bytes.Buffer, v any) error { if err := enc.Encode(v); err != nil { return err } @@ -205,7 +205,7 @@ func isType(schema *jsonschema.Schema, typ jsonschema.PrimitiveType) bool { } func extraField(schema *jsonschema.Schema, name string) string { - var m map[string]interface{} + var m map[string]any if schema.Raw == nil { return "" } @@ -229,9 +229,9 @@ type propertyGroup struct { // property represents a jsonschema.Schema.Properties and its name in a single structure. type property struct { - name string // property name - comment string // doc comment - value *interface{} // default value (or const value) - examples []interface{} // other example values - first bool // show this property at the top + name string // property name + comment string // doc comment + value *any // default value (or const value) + examples []any // other example values + first bool // show this property at the top }