refactor: yet another one, someday I might be happy

This commit is contained in:
2024-03-24 03:28:08 +00:00
parent ccc3668fa2
commit de3a9e55a8
18 changed files with 613 additions and 499 deletions

View File

@@ -17,10 +17,10 @@ type YAML struct {
var _ FormatRenderer = (*YAML)(nil)
// Render marshals the given value to YAML.
func (j *YAML) Render(w io.Writer, v any) error {
func (y *YAML) Render(w io.Writer, v any) error {
enc := yaml.NewEncoder(w)
indent := j.Indent
indent := y.Indent
if indent == 0 {
indent = 2
}
@@ -34,3 +34,7 @@ func (j *YAML) Render(w io.Writer, v any) error {
return nil
}
func (y *YAML) Formats() []string {
return []string{"yaml", "yml"}
}