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

Method displayDiffForNullInt

util/ui/ui_for_push.go:149–161  ·  view source on GitHub ↗
(offset string, header string, oldValue types.NullInt, newValue types.NullInt)

Source from the content-addressed store, hash-verified

147}
148
149func (ui UI) displayDiffForNullInt(offset string, header string, oldValue types.NullInt, newValue types.NullInt) {
150 if oldValue != newValue {
151 formattedOld := fmt.Sprintf("- %s%s%d", ui.TranslateText(header), offset, oldValue.Value)
152 formattedNew := fmt.Sprintf("+ %s%s%d", ui.TranslateText(header), offset, newValue.Value)
153
154 if oldValue.IsSet {
155 fmt.Fprintln(ui.Out, ui.modifyColor(formattedOld, color.New(color.FgRed)))
156 }
157 fmt.Fprintln(ui.Out, ui.modifyColor(formattedNew, color.New(color.FgGreen)))
158 } else {
159 fmt.Fprintf(ui.Out, " %s%s%d\n", ui.TranslateText(header), offset, oldValue.Value)
160 }
161}
162
163func (ui UI) displayDiffForString(offset string, header string, hiddenValue bool, oVal string, nVal string) {
164 if oVal != nVal {

Callers 1

DisplayChangeForPushMethod · 0.95

Calls 2

TranslateTextMethod · 0.95
modifyColorMethod · 0.95

Tested by

no test coverage detected