Format returns a pretty-printed representation of the value
(long bool)
| 23 | |
| 24 | // Format returns a pretty-printed representation of the value |
| 25 | func (v value) Format(long bool) string { |
| 26 | buf := strings.Builder{} |
| 27 | |
| 28 | e := yaml.NewEncoder(&buf) |
| 29 | e.SetIndent(2) |
| 30 | |
| 31 | err := e.Encode(v.Value()) |
| 32 | if err != nil { |
| 33 | panic(err) |
| 34 | } |
| 35 | |
| 36 | return strings.TrimSpace(buf.String()) |
| 37 | } |
| 38 | |
| 39 | func stubValue(v value) string { |
| 40 | switch v.Value().(type) { |