mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-22 00:15:39 +00:00
Merge pull request #19 from stephen679/check_valid_keyword
check: error out on unrecognized keyword
This commit is contained in:
commit
818b9227d7
1 changed files with 3 additions and 3 deletions
6
check.go
6
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
|
||||
|
|
Loading…
Reference in a new issue