Merge pull request #130 from dnfield/master

Update parser_windows.go
This commit is contained in:
Vasily Romanov
2017-08-24 10:26:42 +03:00
committed by GitHub
+5 -2
View File
@@ -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