diff --git a/check.go b/check.go index 44c0ea2..25ee07b 100644 --- a/check.go +++ b/check.go @@ -63,13 +63,13 @@ func Check(root string, dh *DirectoryHierarchy, keywords []string) (*Result, err } for _, kv := range kvs { - if keywords != nil && !inSlice(kv.Keyword(), keywords) { - continue - } keywordFunc, ok := KeywordFuncs[kv.Keyword()] if !ok { return nil, fmt.Errorf("Unknown keyword %q for file %q", kv.Keyword(), e.Path()) } + if keywords != nil && !inSlice(kv.Keyword(), keywords) { + continue + } curKeyVal, err := keywordFunc(filepath.Join(root, e.Path()), info) if err != nil { return nil, err