From 5399fd04d0b7481a8ef05e4ff6a6a5e8492f5b8e Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Wed, 13 Apr 2016 16:04:48 -0400 Subject: [PATCH] check: add an example for the docs Signed-off-by: Vincent Batts --- check_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/check_test.go b/check_test.go index b041d47..de7c96c 100644 --- a/check_test.go +++ b/check_test.go @@ -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 ... + } +}