golang / vscode-go

Go extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=golang.Go
Other
3.78k stars 728 forks source link

gopls: automated issue report (crash) #3304

Closed Mathiasriv closed 2 months ago

Mathiasriv commented 3 months ago

gopls version: v0.15.2/go1.19.8 gopls flags: update flags: proxy extension version: 0.41.2 environment: Visual Studio Code linux initialization error: undefined issue timestamp: Tue, 02 Apr 2024 11:55:17 GMT restart history: Tue, 02 Apr 2024 11:54:58 GMT: activation (enabled: true)

ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.

Describe what you observed.

panic: invalid Go version "go1.22.1" (should be something like "go1.12")

goroutine 148 [running]:
go/types.NewChecker(0x0%3F, 0xc000311b00, 0xc00022e910, 0x0%3F)
      check.go:240  0x24e
golang.org/x/tools/gopls/internal/cache.(*analysisNode).typeCheck(0xc0003e5d90, {0xc000302408, 0x1, 0x1})
      analysis.go:1028  0x72c
golang.org/x/tools/gopls/internal/cache.(*analysisNode).run(0xc0003e5d90, {0x1084320, 0xc0004c38c0})
      analysis.go:810  0xd9
golang.org/x/tools/gopls/internal/cache.(*analysisNode).runCached(0xc0003e5d90, {0x1084320%3F, 0xc0004c38c0})
      analysis.go:672  0x145
golang.org/x/tools/gopls/internal/cache.(*Snapshot).Analyze.func6.1()
      analysis.go:398  0xda
golang.org/x/sync/errgroup.(*Group).Go.func1()
      errgroup.go:78  0x64
created by golang.org/x/sync/errgroup.(*Group).Go
      errgroup.go:75  0xa5
gopls stats -anon { "DirStats": { "Files": 46, "TestdataFiles": 0, "GoFiles": 5, "ModFiles": 2, "Dirs": 33 }, "GOARCH": "amd64", "GOOS": "linux", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.19.8", "GoplsVersion": "v0.15.2", "InitialWorkspaceLoadDuration": "34.958126ms", "MemStats": { "HeapAlloc": 2122184, "HeapInUse": 4251648, "TotalAlloc": 9380152 }, "WorkspaceStats": { "Files": { "Total": 0, "Largest": 0, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.22.1", "AllPackages": { "Packages": 0, "LargestPackage": 0, "CompiledGoFiles": 0, "Modules": 0 }, "WorkspacePackages": { "Packages": 0, "LargestPackage": 0, "CompiledGoFiles": 0, "Modules": 0 }, "Diagnostics": 0 } ] } }
OPTIONAL: If you would like to share more information, you can attach your complete gopls logs. NOTE: THESE MAY CONTAIN SENSITIVE INFORMATION ABOUT YOUR CODEBASE. DO NOT SHARE LOGS IF YOU ARE WORKING IN A PRIVATE REPOSITORY.
hyangah commented 3 months ago

@Mathiasriv can you please reinstall the gopls using go1.22.x? Looks like the gopls was built with go1.19.8. Out of curiosity, wasn't there a popup asking to reinstall gopls?

Thanks for the report!

Mathiasriv commented 3 months ago

@Mathiasriv can you please reinstall the gopls using go1.22.x? Looks like the gopls was built with go1.19.8. Out of curiosity, wasn't there a popup asking to reinstall gopls?

Thanks for the report!

Not that I remember!. I'm going to try.

findleyr commented 2 months ago

This was also fixed in gopls@v0.15.3.