check: implement "missing" failure type

If a file is missing, previously the check would simply fail. This
allows you to get information even if files are missing from the tree.
This also implements some of the wrappers required to add more failure
states.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
Aleksa Sarai 2016-07-23 13:44:16 +10:00
parent 05161ec9df
commit 37060d602b
No known key found for this signature in database
GPG key ID: 9E18AA267DDB8DB4
2 changed files with 114 additions and 12 deletions

View file

@ -45,7 +45,7 @@ var formats = map[string]func(*mtree.Result) string{
"text": func(r *mtree.Result) string {
var buffer bytes.Buffer
for _, fail := range r.Failures {
fmt.Fprintf(&buffer, "modified\t%s\n", fail.Path)
fmt.Fprintf(&buffer, "%s\t%s\n", fail.Type(), fail.Path())
}
return buffer.String()
},