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

Function formatSlice

cft/diff/format.go:63–83  ·  view source on GitHub ↗
(s slice, path []interface{}, long bool)

Source from the content-addressed store, hash-verified

61}
62
63func formatSlice(s slice, path []interface{}, long bool) string {
64 output := strings.Builder{}
65
66 for i, v := range s {
67 m := v.Mode()
68
69 if !long && m == Unchanged {
70 continue
71 }
72
73 output.WriteString(fmt.Sprintf("%s [%d]:", m, i))
74
75 if !long && (m == Removed || m == Unchanged) {
76 output.WriteString(" " + stubValue(v.(value)) + "\n")
77 } else {
78 output.WriteString(formatSub(v, append(path, i), long))
79 }
80 }
81
82 return output.String()
83}
84
85func formatMap(m dmap, path []interface{}, long bool) string {
86 output := strings.Builder{}

Callers 2

FormatMethod · 0.85
formatDiffFunction · 0.85

Calls 4

stubValueFunction · 0.85
formatSubFunction · 0.85
ModeMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected