1
0
Fork 0
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:
Vincent Batts 2016-04-13 16:04:48 -04:00
parent b11b9c6a78
commit 5399fd04d0

View file

@ -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 ...
}
}