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