Open aykevl opened 2 months ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Interestingly, @gabyhelp didn't show exact duplicates but does show this bug has been around for a while: it's also visible in #28491.
CC @matloob, @samthanawalla.
Go version
go version go1.23.1 linux/arm64
Output of
go env
in your module/workspace:What did you do?
I have the following invalid Go file
I ran
go list -json -e importpath.go
on it, to see the loader error.What did you see happen?
The JSON contains this part:
That's an error, of course, but the
Pos
field is not set even thoughgo list
clearly knows the source location (it's stored in the error message itself).What did you expect to see?
I expected an output like this:
That is, the position information should be in
Pos
and the path should be relative and not absolute. For example, when setting the import path to one that doesn't exist, the error looks like this: