Closed Sangwaniya closed 1 month ago
this issue is the same that https://github.com/golang/go/issues/67156 So closing this one
@Sangwaniya do you by any chance have a replace directive in your go.mod file? Perhaps one that is an absolute windows file path?
@findleyr yes i forgot about that
in windows path separator value is "\" (double backslash) butt i changed to '/' to avoid error while extracting data from aws using cli.
after that i haven't changed back, btw windows always giving error due to this path separator value, needs to update it on many tasks 😵💫
@Sangwaniya are you saying that the crash was avoided once you changed the path separator back, and rebuilt gopls?
I would expect that very few applications work correctly on windows when build with a modified GOROOT that changes the path separator.
@findleyr I corrected the path separator value but still gopls crashing. here is crashing report after the correcting the path separator value: gopls version: v0.15.3/go1.21.6 gopls flags: update flags: proxy extension version: 0.41.4 environment: Visual Studio Code win32 initialization error: undefined issue timestamp: Wed, 29 May 2024 14:11:39 GMT restart history: Wed, 29 May 2024 14:08:10 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
panic: runtime error: slice bounds out of range [45:44] goroutine 6535 [running]: golang.org/x/tools/internal/imports.(*ModuleResolver).scanDirForPackage(0xc000e6e840, {{0xc00536f6a5%3F, 0x3071f2db721b2800%3F}, 0x8%3F}, {0xc0077bcb40, 0x2c}) mod.go:727 0x705 golang.org/x/tools/internal/imports.(*ModuleResolver).scan.func3({{0xc00536f6a5%3F, 0xeb5e20%3F}, 0xc006a09760%3F}, {0xc0077bcb40%3F, 0x18c12a8%3F}) mod.go:601 0x50 golang.org/x/tools/internal/gopathwalk.(*walker).walk(0xc0067a3c20, {0xc0089d5640, 0x37}, 0x0, {0x12f0af8, 0xc006dff650}) walk.go:268 0x3d7 golang.org/x/tools/internal/gopathwalk.(*walker).walk(0xc0067a3c20, {0xc00536f6a5, 0x2c}, 0x0, {0x12f0b30, 0xc006a09740}) walk.go:334 0x87b golang.org/x/tools/internal/gopathwalk.walkDir({{0xc00536f6a5%3F, 0xc003037f18%3F}, 0xc003037f18%3F}, 0xc006a09710, 0xc006a09700, {0x0%3F, 0x0%3F, 0x4%3F}) walk.go:120 0x366 golang.org/x/tools/internal/gopathwalk.WalkSkip(...) walk.go:77 golang.org/x/tools/internal/imports.(*ModuleResolver).scan.func4() mod.go:626 0x2db created by golang.org/x/tools/internal/imports.(*ModuleResolver).scan in goroutine 4807 mod.go:610 0x465
@Sangwaniya did you rebuild gopls after making this fix?
Let's continue discussion on golang/go#67156.
gopls version: v0.15.3/go1.21.6 gopls flags: update flags: proxy extension version: 0.41.4 environment: Visual Studio Code win32 initialization error: undefined issue timestamp: Thu, 23 May 2024 12:47:58 GMT restart history: Thu, 23 May 2024 12:44:26 GMT: activation (enabled: true)
ATTENTION: PLEASE PROVIDE THE DETAILS REQUESTED BELOW.
Describe what you observed.
gopls stats -anon
{ "DirStats": { "Files": 2172, "TestdataFiles": 0, "GoFiles": 1626, "ModFiles": 2, "Dirs": 563 }, "GOARCH": "amd64", "GOOS": "windows", "GOPACKAGESDRIVER": "", "GOPLSCACHE": "", "GoVersion": "go1.21.6", "GoplsVersion": "v0.15.3", "InitialWorkspaceLoadDuration": "5.2947379s", "MemStats": { "HeapAlloc": 31101496, "HeapInUse": 39739392, "TotalAlloc": 69362360 }, "WorkspaceStats": { "Files": { "Total": 2207, "Largest": 1654271, "Errs": 0 }, "Views": [ { "GoCommandVersion": "go1.21.6", "AllPackages": { "Packages": 417, "LargestPackage": 134, "CompiledGoFiles": 2217, "Modules": 49 }, "WorkspacePackages": { "Packages": 0, "LargestPackage": 0, "CompiledGoFiles": 0, "Modules": 0 }, "Diagnostics": 0 } ] } }