(offset string, header string, oldList []string, newList []string)
| 187 | } |
| 188 | |
| 189 | func (ui UI) displayDiffForStrings(offset string, header string, oldList []string, newList []string) { |
| 190 | fmt.Fprintf(ui.Out, " %s\n", ui.TranslateText(header)) |
| 191 | |
| 192 | fullList := sortedUniqueArray(oldList, newList) |
| 193 | for _, item := range fullList { |
| 194 | inOld := existsIn(item, oldList) |
| 195 | inNew := existsIn(item, newList) |
| 196 | |
| 197 | switch { |
| 198 | case inOld && inNew: |
| 199 | fmt.Fprintf(ui.Out, " %s\n", item) |
| 200 | case inOld: |
| 201 | formattedOld := fmt.Sprintf("- %s", item) |
| 202 | fmt.Fprintln(ui.Out, ui.modifyColor(formattedOld, color.New(color.FgRed))) |
| 203 | default: |
| 204 | formattedNew := fmt.Sprintf("+ %s", item) |
| 205 | fmt.Fprintln(ui.Out, ui.modifyColor(formattedNew, color.New(color.FgGreen))) |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | func (ui UI) displayDiffForUint64(offset string, header string, oldValue uint64, newValue uint64) { |
| 211 | if oldValue != newValue { |
no test coverage detected