From e85261d0c603a6fd8e13e764a4da598a51a57353 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 11 Jun 2025 02:25:51 +0100 Subject: [PATCH] fix(json)!: correct spelling of JSONDefaultIndent (#7) Fix misspelled variable name `JSONDefualtIndent` to `JSONDefaultIndent` throughout the codebase. Update documentation to reference this correctly spelled variable in the JSON struct's Indent field comment. BREAKING CHANGE: Rename `JSONDefualtIndent` to correctly spelled `JSONDefaultIndent`. --- json.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/json.go b/json.go index 295f111..024026a 100644 --- a/json.go +++ b/json.go @@ -6,9 +6,9 @@ import ( "io" ) -// JSONDefualtIndent is the default indentation string used by JSON instances +// JSONDefaultIndent is the default indentation string used by JSON instances // when pretty rendering if no Indent value is set on the JSON instance itself. -var JSONDefualtIndent = " " +var JSONDefaultIndent = " " // JSON is a Handler that marshals values to JSON. type JSON struct { @@ -17,7 +17,7 @@ type JSON struct { Prefix string // Indent is the string added to each level of indentation when pretty - // rendering. If empty, two spaces will be used instead. + // rendering. If empty, JSONDefaultIndent will be used. Indent string } @@ -43,7 +43,7 @@ func (jr *JSON) RenderPretty(w io.Writer, v any) error { prefix := jr.Prefix indent := jr.Indent if indent == "" { - indent = JSONDefualtIndent + indent = JSONDefaultIndent } enc := json.NewEncoder(w)