fix(xml)!: correct spelling of XMLDefaultIndent (#6)

Fixes typo in variable name and references from 'XMLDefualtIndent' to 
'XMLDefaultIndent'. Updates the variable declaration and all references 
to maintain consistency throughout the XML renderer implementation.

BREAKING CHANGE: Rename `XMLDefualtIndent` to correctly spelled `XMLDefaultIndent`.
This commit is contained in:
2025-06-11 02:19:30 +01:00
committed by GitHub
parent c3408f0cfb
commit 2fb5fea7fb

8
xml.go
View File

@@ -6,9 +6,9 @@ import (
"io" "io"
) )
// XMLDefualtIndent is the default indentation string used by XML instances when // XMLDefaultIndent is the default indentation string used by XML instances when
// pretty rendering if no Indent value is set. // pretty rendering if no Indent value is set.
var XMLDefualtIndent = " " var XMLDefaultIndent = " "
// XML is a Renderer that marshals a value to XML. // XML is a Renderer that marshals a value to XML.
type XML struct { type XML struct {
@@ -17,7 +17,7 @@ type XML struct {
Prefix string Prefix string
// Indent is the string added to each level of indentation when pretty // Indent is the string added to each level of indentation when pretty
// rendering. If empty, XMLDefualtIndent be used. // rendering. If empty, XMLDefaultIndent will be used.
Indent string Indent string
} }
@@ -43,7 +43,7 @@ func (x *XML) RenderPretty(w io.Writer, v any) error {
prefix := x.Prefix prefix := x.Prefix
indent := x.Indent indent := x.Indent
if indent == "" { if indent == "" {
indent = XMLDefualtIndent indent = XMLDefaultIndent
} }
enc := xml.NewEncoder(w) enc := xml.NewEncoder(w)