This seems to have occurred several years ago (#3027). Obviously fixed and closed, but has come back!
What version of Go are you using (go version)?
$ go version
go version go1.17.3 windows/amd64
gopls is 0.29.0 (as far as I can tell)
visual studio code
Version: 1.62.0 (system setup)
OS: Windows_NT x64 10.0.19042
Does this issue reproduce with the latest release?
yes, but it failed on previous go (1.17.2) as well and previous vs code, too. I updated both to see if the problem would go away.
What operating system and processor architecture are you using (go env)?
go env Output
$ go env
set GOROOT=C:\Program Files\Go
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set CGO_CFLAGS=-g -O2
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\msys64\tmp\go-build1397263953=/tmp/go-build -gno-record-gcc-switches
What did you do?
Made small alteration in go program and used ^S to save. File corrupted -- characters deleted.
Thanks for replying. I am attaching a file with the requested data. I had to make a few attempts to reproduce the failure, but since the trace and info were running while I did these, I hope the errant behavior will show up, Let me know if you'd like more information.
I finally got to looking at this a bit. It looks like there may be some edit fighting going on -- could you share your VS Code settings.json. Also, do you have any other extensions that operate on Go code?
Thanks for replying. I won't have access to the computer that was displaying the problem for some months. If you need more from me, I'll have to see if the problem crops up on one of the other computers I'm using, but in the interest of making progress on my project, I've temporarily reverted to a slightly older version of gopls and will wait for a new one to appear before updating again.