When I save file, VSCode auto cleans the not used code, How to Disable it? I want to make VSCode not to delete any line of my code.

The setting source.organizeImports removes unused imports when you save. Set the value to "never" to prevent removing unused imports.
{
"[go]": {
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
}
},
}
See also: vscode-go documentation https://github.com/golang/vscode-go/wiki/advanced#formatting-code-and-organizing-imports
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With