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
1 changed files with 15 additions and 0 deletions

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