mirror of
https://github.com/github/codeql.git
synced 2026-01-29 06:12:58 +01:00
Evaluate symlinks for the dummy file
This commit is contained in:
@@ -460,11 +460,17 @@ func (extraction *Extraction) extractError(tw *trap.Writer, err packages.Error,
|
||||
|
||||
if pos == "" {
|
||||
// extract a dummy file
|
||||
file, e = filepath.Abs(filepath.Join(".", "-"))
|
||||
wd, e := os.Getwd()
|
||||
if e != nil {
|
||||
file = filepath.Join(".", "-")
|
||||
log.Printf("Warning: failed to get absolute path for for %s", file)
|
||||
wd = "."
|
||||
log.Printf("Warning: failed to get working directory")
|
||||
}
|
||||
ewd, e := filepath.EvalSymlinks(wd)
|
||||
if e != nil {
|
||||
ewd = wd
|
||||
log.Printf("Warning: failed to evaluate symlinks for %s", wd)
|
||||
}
|
||||
file = filepath.Join(ewd, "-")
|
||||
} else {
|
||||
var rawfile string
|
||||
if parts := threePartPos.FindStringSubmatch(pos); parts != nil {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
| ../Diagnostics:0:0:0:0 | malformed import path "github.com/github/codeql-go/ql/test/query-tests/Diagnostics/invalid{": invalid char '{' |
|
||||
| -:0:0:0:0 | malformed import path "github.com/github/codeql-go/ql/test/query-tests/Diagnostics/invalid{": invalid char '{' |
|
||||
| bad.go:3:1:3:1 | expected 'package', found avvu |
|
||||
| type.go:11:9:11:9 | cannot use v (variable of type V) as T value in argument to takesT |
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
| Extraction failed in query-tests/Diagnostics/type.go with error cannot use v (variable of type V) as T value in argument to takesT | 2 |
|
||||
| Extraction failed with error expected 'package', found avvu | 2 |
|
||||
| Extraction failed with error malformed import path "github.com/github/codeql-go/ql/test/query-tests/Diagnostics/invalid{": invalid char '{' | 2 |
|
||||
|
||||
Reference in New Issue
Block a user