From 01d6457c01d1f088b6b483dd8961babc87e4604f Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 26 Jul 2017 11:08:51 -0400 Subject: [PATCH] Update parser_windows.go Use filepath.IsAbs instead of path.IsAbs for Windows; convert paths to lowercase when normalizing them --- parser/parser_windows.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/parser/parser_windows.go b/parser/parser_windows.go index 64974aa..a0b2611 100644 --- a/parser/parser_windows.go +++ b/parser/parser_windows.go @@ -4,15 +4,18 @@ import ( "fmt" "os" "path" + "path/filepath" "strings" ) func normalizePath(path string) string { - return strings.Replace(path, "\\", "/", -1) + // use lower case, as Windows file systems will almost always be case insensitive + return strings.ToLower(strings.Replace(path, "\\", "/", -1)) } func getPkgPath(fname string, isDir bool) (string, error) { - if !path.IsAbs(fname) { + // path.IsAbs doesn't work properly on Windows; use filepath.IsAbs instead + if !filepath.IsAbs(fname) { pwd, err := os.Getwd() if err != nil { return "", err