Closed stapelberg closed 9 months ago
Is this change intentional or should the behavioral change be corrected?
It is unintentional. Though I think you could fix it in your program by just removing the ImportPaths
. I guess the previous version would first try to resolve the given filename without using the import paths, which would work since the path is absolute. But the current version is always trying to evaluate the filename with a given import path, so when it prefixes the filename with that path, you get the duplicated path components and the error.
I’m not sure if removing ImportPaths
is a safe change to make in all of the affected programs.
This particular issue seems to be the most significant blocker for the v1.15.4 upgrade, with the largest number of affected tests / programs — if it’s easy enough to fix/relax, I would much prefer that over trying to convince the affected teams to remove ImportPaths
:)
Thanks
Okay, I see what's going on. This is definitely a bug since the behavior you were previously seeing is in fact specified in the Go docs for the Parser.ImportPaths
field. That field is not supposed to be used for ParseFilesButDoNotLink
. My bad 🤦
Here’s a small test program that breaks when upgrading:
Is this change intentional or should the behavioral change be corrected?