WriteYAML encodes v as YAML to w.
(w io.Writer, v any)
| 19 | |
| 20 | // WriteYAML encodes v as YAML to w. |
| 21 | func WriteYAML(w io.Writer, v any) error { |
| 22 | enc := yaml.NewEncoder(w) |
| 23 | enc.SetIndent(2) |
| 24 | defer enc.Close() |
| 25 | return enc.Encode(v) |
| 26 | } |
| 27 | |
| 28 | // ValidateFormat checks that format is one of the supported values. |
| 29 | func ValidateFormat(format string, supported []string) error { |
no outgoing calls