mirror of
https://github.com/golang/go
synced 2024-11-14 17:30:29 -07:00
Fix a npe in test.go
This commit is contained in:
parent
5cb7b6aae3
commit
d76568d7ee
@ -546,9 +546,13 @@ func recompileForTest(pmain, preal, ptest, pxtest *Package) *PackageError {
|
||||
// by x, and then we reverse it.
|
||||
var stk ImportStack
|
||||
for p != nil {
|
||||
tokenPositions := []token.Position{}
|
||||
if importerOf[p].Internal.Build != nil {
|
||||
tokenPositions = importerOf[p].Internal.Build.ImportPos[p.ImportPath]
|
||||
}
|
||||
stk = append(stk, ImportInfo{
|
||||
Pkg: p.ImportPath,
|
||||
Pos: extractFirstImport(importerOf[p].Internal.Build.ImportPos[p.ImportPath]),
|
||||
Pos: extractFirstImport(tokenPositions),
|
||||
})
|
||||
p = importerOf[p]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user