Skip to content

Vs Code Go extension deleting my code. . . Help! 😥 #2490

Answered by suzmue
Major2000 asked this question in Help
Discussion options

You must be logged in to vote

Deleting unused imports is the default behavior to help saved files can compile - In Go, unused imports are compile-time errors.

For different behavior, follow the instruction in "Formatting Code and Organizing Imports".

"[go]": { "editor.codeActionsOnSave": { "source.organizeImports": false }}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@d9j
Comment options

@ingframin
Comment options

Answer selected by h9jiang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants