MCPcopy Create free account
hub / github.com/aws-cloudformation/rain / Format

Method Format

cft/diff/format.go:25–37  ·  view source on GitHub ↗

Format returns a pretty-printed representation of the value

(long bool)

Source from the content-addressed store, hash-verified

23
24// Format returns a pretty-printed representation of the value
25func (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
39func stubValue(v value) string {
40 switch v.Value().(type) {

Callers

nothing calls this directly

Calls 2

ValueMethod · 0.95
StringMethod · 0.65

Tested by

no test coverage detected