mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 10:11:03 +00:00
This makes container image details show the containers (and processes) correctly. Also: - introduces a 'test' package, moved Diff function there. - adds some tests for this new rendered view.
23 lines
458 B
Go
23 lines
458 B
Go
package test
|
|
|
|
import (
|
|
"github.com/davecgh/go-spew/spew"
|
|
"github.com/pmezard/go-difflib/difflib"
|
|
)
|
|
|
|
func init() {
|
|
spew.Config.SortKeys = true // :\
|
|
}
|
|
|
|
// Diff diff diff
|
|
func Diff(want, have interface{}) string {
|
|
text, _ := difflib.GetUnifiedDiffString(difflib.UnifiedDiff{
|
|
A: difflib.SplitLines(spew.Sdump(want)),
|
|
B: difflib.SplitLines(spew.Sdump(have)),
|
|
FromFile: "want",
|
|
ToFile: "have",
|
|
Context: 3,
|
|
})
|
|
return "\n" + text
|
|
}
|