Refactoring XML encoder prefs

This commit is contained in:
Mike Farah
2024-02-24 15:03:30 +11:00
parent 571caa696a
commit 2866e90c49
6 changed files with 38 additions and 16 deletions
+4 -1
View File
@@ -10,6 +10,7 @@ import (
)
func configureEncoder(format *PrinterOutputFormat, indent int) Encoder {
switch format {
case JSONOutputFormat:
return NewJSONEncoder(indent, false, false)
@@ -22,7 +23,9 @@ func configureEncoder(format *PrinterOutputFormat, indent int) Encoder {
case YamlOutputFormat:
return NewYamlEncoder(indent, false, ConfiguredYamlPreferences)
case XMLOutputFormat:
return NewXMLEncoder(indent, ConfiguredXMLPreferences)
var xmlPrefs = ConfiguredXMLPreferences.Copy()
xmlPrefs.Indent = indent
return NewXMLEncoder(xmlPrefs)
case Base64OutputFormat:
return NewBase64Encoder()
case UriOutputFormat: