mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Go: be consistent in replacement of backslashes in file labels
This commit is contained in:
@@ -3,6 +3,7 @@ package trap
|
||||
import (
|
||||
"fmt"
|
||||
"go/types"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/github/codeql-go/extractor/srcarchive"
|
||||
"github.com/github/codeql-go/extractor/util"
|
||||
@@ -75,7 +76,7 @@ func (l *Labeler) FileLabel() Label {
|
||||
|
||||
// FileLabelFor returns the label for the file for which the trap writer `tw` is associated
|
||||
func (l *Labeler) FileLabelFor(path string) Label {
|
||||
return l.GlobalID(util.EscapeTrapSpecialChars(path) + ";sourcefile")
|
||||
return l.GlobalID(util.EscapeTrapSpecialChars(filepath.ToSlash(path)) + ";sourcefile")
|
||||
}
|
||||
|
||||
// LocalID associates a label with the given AST node `nd` and returns it
|
||||
|
||||
Reference in New Issue
Block a user