🌐 AI搜索 & 代理 主页
Skip to content

Commit 087d707

Browse files
Fixing windows path issue
1 parent 72c04f3 commit 087d707

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

compiler/declNames.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"go/token"
66
"go/types"
7-
"path"
7+
"path/filepath"
88
"strings"
99

1010
"github.com/gopherjs/gopherjs/compiler/internal/symbol"
@@ -129,7 +129,8 @@ func declFullNameDiscriminator(pos token.Pos, fSet *token.FileSet) string {
129129
return ``
130130
}
131131
p := fSet.Position(pos)
132-
return fmt.Sprintf("@%s:%d:%d", path.Base(p.Filename), p.Line, p.Column)
132+
fileName := filepath.Base(filepath.ToSlash(p.Filename))
133+
return fmt.Sprintf("@%s:%d:%d", fileName, p.Line, p.Column)
133134
}
134135

135136
// isUnqueDeclFullName reports whether the given declaration full name is unique.

0 commit comments

Comments
 (0)