syclee
syclee

Reputation: 697

How to run `go fmt` on demand after disabling it on save, in Visual Studio Code

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?

Upvotes: 0

Views: 1162

Answers (1)

michael kaltenecker
michael kaltenecker

Reputation: 33

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

Upvotes: 0

Related Questions