-
Notifications
You must be signed in to change notification settings - Fork 17.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: expected 'package', found 'EOF'
errors with module indexing enabled on WSL2
#54651
Comments
This one close go-delve/delve#3118 cc @bcmills |
Assigned @bcmills for now, anyone looking at this should know that this is not reproducible in general (I tried with 1.19 and tip on macOS and Linux), but there was nonetheless a problem, which is linked to the delve bug and referenced files above. So it remains open. |
By the way @dr2chase, I work with Debian on WSL. |
Hello |
@jhaumont, just to rule out filesystem weirdness, what filesystem are you using for |
And does running |
@bcmills I'm on WSL. This is the result of |
Is this WSL1 or WSL2? |
@aarzilli WSL2 with debian |
This is currently the only report we have of this kind of corruption. It's not clear to me whether this is a bug in Go, a bug in WSL2, or both. Moving to the Backlog pending more user reports and/or test failures that might shed some light for debugging. |
expected 'package', found 'EOF'
errors with module indexing enabled on WSL2
I have go on both my system and I am having the same issue after installing go and trying to run a go file "go:1:1: expected 'package', found 'EOF'" package main func main() { } |
I've faced the same issue today. If I run
Something about the location of building directory appears to cause the error. First of all, the problem is only caused when the building directory is either Permissions don't seem to cause the error. I've removed and created go version
go envoutput
what I did
what I expected to seeoutput
what I sawoutput
|
The problem has been resolved after I deleted go-build cache in |
I've faced the same issue today. |
@azat-reason @Windeal are you using WSL2? |
Had the issue on centOS 7. |
Well I was having a lot of |
Hello |
It's helpful! Works for me after |
Using VS Code for GO, and faced the same issue. Saving the file 'Ctrl+S' on Windows fixed the issue. |
nice, solved my problem |
currently having this issue on Linux Mint 21.2 when run as a normal user: runs fine when run as root, fails in sudo |
Thanks, it is helpful. |
This can also be due to go files in the module, not having the |
|
Full clean by these if folder exists
Then it should be fresh for go |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
When installing 1.19 go version & reinstall/update the additional go tools like gopls & dlv, I have an issue with delve and the package https://github.com/hashicorp/golang-lru/tree/master/simplelru.
So, I can't install delve. But if I use the 1.18.5 version of go, I have no issue and I can install the last delve version (1.9.0)
But if I use
GODEBUG=goindex=0
, it works :)Reproduce:
I try to do a fresh install of go (with 1.19.0) and then, install delve.
What did you expect to see?
No error, devel is correctly installed
What did you see instead?
pkg/mod/github.com/hashicorp/golang-lru@v0.5.4/simplelru/lru.go:1:1: expected 'package', found 'EOF'
The text was updated successfully, but these errors were encountered: