ToYAML takes a string of arguments and converts to a YAML document.
(s string)
| 41 | |
| 42 | // ToYAML takes a string of arguments and converts to a YAML document. |
| 43 | func ToYAML(s string) (string, error) { |
| 44 | m, err := Parse(s) |
| 45 | if err != nil { |
| 46 | return "", err |
| 47 | } |
| 48 | d, err := yaml.Marshal(m) |
| 49 | return strings.TrimSuffix(string(d), "\n"), err |
| 50 | } |
| 51 | |
| 52 | // Parse parses a set line. |
| 53 | // |
searching dependent graphs…