mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-05 00:15:58 +00:00
check: add an example for the docs
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
b11b9c6a78
commit
5399fd04d0
1 changed files with 15 additions and 0 deletions
|
@ -80,3 +80,18 @@ func TestCheckKeywords(t *testing.T) {
|
|||
t.Errorf("%#v", res)
|
||||
}
|
||||
}
|
||||
|
||||
func ExampleCheck() {
|
||||
dh, err := Walk(".", nil, append(DefaultKeywords, "sha1"))
|
||||
if err != nil {
|
||||
// handle error ...
|
||||
}
|
||||
|
||||
res, err := Check(".", dh, nil)
|
||||
if err != nil {
|
||||
// handle error ...
|
||||
}
|
||||
if len(res.Failures) > 0 {
|
||||
// handle failed validity ...
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue