Closed
Description
Using Go 1.12.
// +build ignore
package main
import (
"fmt"
"golang.org/x/tools/go/packages"
)
func main() {
cfg := &packages.Config{
Mode: packages.LoadImports,
}
initial, err := packages.Load(cfg, "fmt", "fmt")
if err != nil {
panic(err)
}
for _, x := range initial {
fmt.Println(x.PkgPath)
}
}
Got:
$ go run bug.go
fmt
Want:
$ go run bug.go
fmt
fmt
Related: #30826. This is important to me for the same reasons.
(For the record, neither of these bugs is theoretical. I hit both of them working on go-fuzz; this one I hit while trying to work around #30826.)
cc @matloob