MCPcopy Index your code
hub / github.com/cloudfoundry/cli / displayDiffForInt

Method displayDiffForInt

util/ui/ui_for_push.go:96–108  ·  view source on GitHub ↗
(offset string, header string, oldValue int, newValue int)

Source from the content-addressed store, hash-verified

94}
95
96func (ui UI) displayDiffForInt(offset string, header string, oldValue int, newValue int) {
97 if oldValue != newValue {
98 formattedOld := fmt.Sprintf("- %s%s%d", ui.TranslateText(header), offset, oldValue)
99 formattedNew := fmt.Sprintf("+ %s%s%d", ui.TranslateText(header), offset, newValue)
100
101 if oldValue != 0 {
102 fmt.Fprintln(ui.Out, ui.modifyColor(formattedOld, color.New(color.FgRed)))
103 }
104 fmt.Fprintln(ui.Out, ui.modifyColor(formattedNew, color.New(color.FgGreen)))
105 } else {
106 fmt.Fprintf(ui.Out, " %s%s%d\n", ui.TranslateText(header), offset, oldValue)
107 }
108}
109
110func (ui UI) displayDiffForMapStringString(offset string, header string, oldMap map[string]string, newMap map[string]string) {
111 var oldKeys []string

Callers 1

DisplayChangeForPushMethod · 0.95

Calls 2

TranslateTextMethod · 0.95
modifyColorMethod · 0.95

Tested by

no test coverage detected