Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
x/tools/gopls: formatting on save inserts an unnecessary package clause #38412
When using with VS Code
gopls version 0.4.0
how to repro:
$ cat main.go
Open the it from the code, and save the file again (command+s). That triggers text edit like:
Attached the gopls log. code.log
File save was requested after the message 7.
Note: when triggering the formatting using "Format Document" (e.g. right click -> "Format Document") the formatting works as expected.