-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
x/tools/gopls: no packages returned: packages.Load error #42353
Comments
What is the output of |
Hi @stamblerre thanks for responding. This is what I see $ go list -e -json -compiled ./... go build internal/unsafeheader: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/c0/c0e94ba9040544ec35c16499ee2905975dd7ec6b24e473a66a3aa2ec46e5f846-a: no such file or directory go build unicode: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/f1/f119670a773db65c0815a7827d762943142c014aeb48566d2b9eaa52f9903efb-a: no such file or directory go build unicode/utf8: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/95/9515ad0b3f4f5f63d1c4bbe8c238ad1345865fcc6118479bfddeec955a538a18-a: no such file or directory go build internal/race: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/97/97a4861b18817b8085b8685e54051446a4204c01b709430231b4257afa1f25cc-a: no such file or directory go build math/bits: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/1b/1b3caccfa06a6e29b2c6bdc528ffc5e7712931e997cb30d477c31e31f2a5dbee-a: no such file or directory go build runtime/internal/sys: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/29/29773ae629eba8ce238a7697425861a0be9c007b61408c0172f688f609ded2d0-a: no such file or directory go build internal/cpu: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/8c/8ca5bd8bd1572a5fecff05df9eeedf7d13b6c23a1320d5373a756df8d645e259-a: no such file or directory go build runtime/internal/atomic: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/51/51a0ab315d5778b2f56dbc221a7220e3d1e24940a9424be9f5e4bd07e321b94b-a: no such file or directory go build sync/atomic: loading compiled Go files from cache: reading srcfiles list: cache entry not found: open /Users/mac/Library/Caches/go-build/f7/f76980501818889a818e399f49f4438edc3b14656a4616df4853c031cee3aa0d-a: no such file or directory { "Dir": "/Users/mac/Documents/projects/myproject/test.com", "ImportPath": "test.com", "Name": "main", "Target": "/Users/mac/go/bin/test.com", "Root": "/Users/mac/Documents/projects/myproject/test.com", "Module": { "Path": "test.com", "Main": true, "Dir": "/Users/mac/Documents/projects/myproject/test.com", "GoMod": "/Users/mac/Documents/projects/myproject/test.com/go.mod", "GoVersion": "1.15" }, "Match": [ "./..." ], "GoFiles": [ "main.go" ], "Imports": [ "fmt" ], "Deps": [ "errors", "fmt", "internal/bytealg", "internal/cpu", "internal/fmtsort", "internal/oserror", "internal/poll", "internal/race", "internal/reflectlite", "internal/syscall/execenv", "internal/syscall/unix", "internal/testlog", "internal/unsafeheader", "io", "math", "math/bits", "os", "reflect", "runtime", "runtime/internal/atomic", "runtime/internal/math", "runtime/internal/sys", "sort", "strconv", "sync", "sync/atomic", "syscall", "time", "unicode", "unicode/utf8", "unsafe" ] } |
Thanks for sharing that output. My guess is that the issue is caused by the issues with the cache entries. Can you try running /cc @matloob @jayconrod @bcmills for further advice, especially since it seems like go/packages failed to pick up any packages with these error messages present |
Yay!! I figured out what issue was After I did
After digging a bit I realized that Now, everything works fine. Thank you @stamblerre for your help!! |
If your
|
This error also happens if the file uses build tags, see #29202 (comment). Trying the mentioned |
Sorry to comment on a closed issue, but this is a huge deal for practically using (setenv "GOFLAGS" "-tags=linux,windows") This seems to let me interoperate between linux and windows tagged files. You could probably add |
I have the same issue, |
What is the path for Linux? |
The path of the go-build cache in the Linux is but in my case, applying |
hey, @computerphilosopher did you find a solution yet or are you living with it? |
In my case, I tried to navigate third-party module codes that are not installed yet. Running |
I was getting this error in lunarvim. My project was using vendoring, and running |
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
Outputgopls trace
OutputWhat did you do?
I am trying to go to the definition of a function. For instance fmt.Println().
I use vim-go
I put the cursor under Println and try to go the definition and I get the below error
The same thing works when I change my definition server to 'guru'
Doesn't work either for user defined functions or for standard package functions
What did you expect to see?
Expected to see the definition of the function
What did you see instead?
The text was updated successfully, but these errors were encountered: