1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-22 00:15:39 +00:00

check: omitempty rather than null

When using `-result-format=json` flag, just show populated fields.

Before:
```bash
$ gomtree -result-format=json -p ./bin -f ./bin.mtree
{"failures":[{"path":"gomtree","keyword":"size","expected":"2646101","got":"2930231"}],"Missing":null,"Extra":null}
```

After:
```bash
$ gomtree -result-format=json -p ./bin -f ./bin.mtree
{"failures":[{"path":"gomtree","keyword":"size","expected":"2646101","got":"2930231"}]}
```

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-07-25 15:39:55 -04:00
parent cc939615c7
commit 898661f983

View file

@ -11,8 +11,8 @@ import (
type Result struct {
// list of any failures in the Check
Failures []Failure `json:"failures"`
Missing []Entry
Extra []Entry
Missing []Entry `json:"missing,omitempty"`
Extra []Entry `json:"extra,omitempty"`
}
// Failure of a particular keyword for a path