mirror of
https://github.com/jimeh/go-render.git
synced 2026-02-19 03:16:39 +00:00
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:
8
xml.go
8
xml.go
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user