mirror of
https://github.com/mikefarah/yq.git
synced 2026-06-28 07:57:43 +00:00
Add INIPreferences.PreserveSurroundedQuote option that wires through to go-ini/ini's LoadOptions.PreserveSurroundedQuote. When enabled, existing surrounding quotes on INI values are preserved during decode/encode round-trips. Fixes #2456 Co-authored-by: toller892 <toller892@gmail.com>
23 lines
489 B
Go
23 lines
489 B
Go
package yqlib
|
|
|
|
type INIPreferences struct {
|
|
ColorsEnabled bool
|
|
PreserveSurroundedQuote bool
|
|
}
|
|
|
|
func NewDefaultINIPreferences() INIPreferences {
|
|
return INIPreferences{
|
|
ColorsEnabled: false,
|
|
PreserveSurroundedQuote: false,
|
|
}
|
|
}
|
|
|
|
func (p *INIPreferences) Copy() INIPreferences {
|
|
return INIPreferences{
|
|
ColorsEnabled: p.ColorsEnabled,
|
|
PreserveSurroundedQuote: p.PreserveSurroundedQuote,
|
|
}
|
|
}
|
|
|
|
var ConfiguredINIPreferences = NewDefaultINIPreferences()
|