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:
parent
cc939615c7
commit
898661f983
1 changed files with 2 additions and 2 deletions
4
check.go
4
check.go
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue