MCPcopy
hub / github.com/getsops/sops / PrettyPrintDiffs

Function PrettyPrintDiffs

cmd/sops/common/common.go:452–465  ·  view source on GitHub ↗

PrettyPrintDiffs prints a slice of Diff objects to stdout

(diffs []Diff)

Source from the content-addressed store, hash-verified

450
451// PrettyPrintDiffs prints a slice of Diff objects to stdout
452func PrettyPrintDiffs(diffs []Diff) {
453 for i, diff := range diffs {
454 color.New(color.Underline).Printf("Group %d\n", i+1)
455 for _, c := range diff.Common {
456 fmt.Printf(" %s\n", c.ToString())
457 }
458 for _, c := range diff.Added {
459 color.New(color.FgGreen).Printf("+++ %s\n", c.ToString())
460 }
461 for _, c := range diff.Removed {
462 color.New(color.FgRed).Printf("--- %s\n", c.ToString())
463 }
464 }
465}
466
467// PrettyPrintShamirDiff prints changes in shamir_threshold to stdout
468func PrettyPrintShamirDiff(oldValue, newValue int) {

Callers 2

updateFileFunction · 0.92
RunFunction · 0.92

Calls 1

ToStringMethod · 0.65

Tested by

no test coverage detected