0

Related to this question about how to run go fmt on save, but for me I have disabled go fmt on save because I don't like the way it removes import statements while I am still working on the code.

I would like to run go fmt on the file I have open when I want to from VS Code. Is there a way to do this?

syclee
  • 697
  • 7
  • 18
  • here is answer how to trigger format in vscode by keyboard shortcut https://stackoverflow.com/a/29973358/12301864 Do you have Go extension installed? – MenyT Sep 24 '21 at 05:08

1 Answers1

0

you can trigger VS-code to format the current document by pressing:

shift + alt + F

or you open the command palette by CTRL + shift + P and then search for format Document