all: add support for Windows

This commit is contained in:
Ayke van Laethem
2019-04-04 15:05:14 +02:00
committed by Ron Evans
parent 8906192690
commit 7369a0e7f2
11 changed files with 157 additions and 28 deletions
+3 -3
View File
@@ -317,9 +317,9 @@ func (p *Program) parseFile(path string, mode parser.Mode) (*ast.File, error) {
defer rd.Close()
relpath := path
if filepath.IsAbs(path) {
relpath, err = filepath.Rel(p.Dir, path)
if err != nil {
return nil, err
rp, err := filepath.Rel(p.Dir, path)
if err == nil {
relpath = rp
}
}
return parser.ParseFile(p.fset, relpath, rd, mode)