From a0b06e0224dfaea4aed8c326296b76ee1ee42698 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Thu, 14 Jul 2016 16:33:23 -0400 Subject: [PATCH] check: recognize correct path Fixes #11. Check() changes its working directory to `root`, which is specified as an argument. Thus, it shouldn't open a file using its absolute path; instead it should open the file with the relative path to the root. Signed-off-by: Stephen Chung --- check.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check.go b/check.go index 44c0ea2..af1ca88 100644 --- a/check.go +++ b/check.go @@ -50,7 +50,7 @@ func Check(root string, dh *DirectoryHierarchy, keywords []string) (*Result, err creator.curSet = nil } case RelativeType, FullType: - info, err := os.Lstat(filepath.Join(root, e.Path())) + info, err := os.Lstat(e.Path()) if err != nil { return nil, err }