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

Method displayDiffForUint64

util/ui/ui_for_push.go:210–222  ·  view source on GitHub ↗
(offset string, header string, oldValue uint64, newValue uint64)

Source from the content-addressed store, hash-verified

208}
209
210func (ui UI) displayDiffForUint64(offset string, header string, oldValue uint64, newValue uint64) {
211 if oldValue != newValue {
212 formattedOld := fmt.Sprintf("- %s%s%d", ui.TranslateText(header), offset, oldValue)
213 formattedNew := fmt.Sprintf("+ %s%s%d", ui.TranslateText(header), offset, newValue)
214
215 if oldValue != 0 {
216 fmt.Fprintln(ui.Out, ui.modifyColor(formattedOld, color.New(color.FgRed)))
217 }
218 fmt.Fprintln(ui.Out, ui.modifyColor(formattedNew, color.New(color.FgGreen)))
219 } else {
220 fmt.Fprintf(ui.Out, " %s%s%d\n", ui.TranslateText(header), offset, oldValue)
221 }
222}
223
224func existsIn(str string, ary []string) bool {
225 for _, val := range ary {

Callers 1

DisplayChangeForPushMethod · 0.95

Calls 2

TranslateTextMethod · 0.95
modifyColorMethod · 0.95

Tested by

no test coverage detected