From 72cbe00536eb9184ce4caa246a00aa66668cc448 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Fri, 8 Jul 2016 17:00:07 -0400 Subject: [PATCH] Recognize path when validating Fixes #11. After changing the directory to the root directory specified, we want to call lstat on a relative path, instead of joining the full root path with the file name. Signed-off-by: Stephen Chung --- check.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/check.go b/check.go index 65e1128..876c64c 100644 --- a/check.go +++ b/check.go @@ -50,8 +50,7 @@ func Check(root string, dh *DirectoryHierarchy, keywords []string) (*Result, err creator.curSet = nil } case RelativeType, FullType: - filename := filepath.Join(root, e.Path()) - info, err := os.Lstat(filename) + info, err := os.Lstat(e.Path()) if err != nil { return nil, err }