How do I disable GoLang’s auto-formatting on file save in VSCode?

I’m new to Go, and trying to make something using it, however, each time I press the save button (or use the shortcut Ctrl+S) (so basically, whenever I save the file MANUALLY).

Though, the strange thing is, I have autosave turned on in VSCode, and the…


This content originally appeared on DEV Community and was authored by Calin Baenen

I'm new to Go, and trying to make something using it, however, each time I press the save button (or use the shortcut Ctrl+S) (so basically, whenever I save the file MANUALLY).

Though, the strange thing is, I have autosave turned on in VSCode, and the file will save after like a second or two, and whenever VSC saves the file, it doesn't get formatted (contrast to when I try to save it myself (as I've just stated)).
There are the GoLang related settings in VSCode's settings.json file:

"go.lintOnSave": "off",
"[go]": {
    "editor.formatOnSave": false,
    "editor.defaultFormatter": null
},
"go.languageServerExperimentalFeatures": {
    "format": false     # Property "format" is not allowed.
}

Can someone please tell me what I'm doing wrong? I looked at this and even looked at what Go themselves had to say on their VSCode extension page, but neither of these are helping.

Thanks a lot in advance!
Cheers!


This content originally appeared on DEV Community and was authored by Calin Baenen


Print Share Comment Cite Upload Translate Updates
APA

Calin Baenen | Sciencx (2021-05-13T19:19:40+00:00) How do I disable GoLang’s auto-formatting on file save in VSCode?. Retrieved from https://www.scien.cx/2021/05/13/how-do-i-disable-golangs-auto-formatting-on-file-save-in-vscode/

MLA
" » How do I disable GoLang’s auto-formatting on file save in VSCode?." Calin Baenen | Sciencx - Thursday May 13, 2021, https://www.scien.cx/2021/05/13/how-do-i-disable-golangs-auto-formatting-on-file-save-in-vscode/
HARVARD
Calin Baenen | Sciencx Thursday May 13, 2021 » How do I disable GoLang’s auto-formatting on file save in VSCode?., viewed ,<https://www.scien.cx/2021/05/13/how-do-i-disable-golangs-auto-formatting-on-file-save-in-vscode/>
VANCOUVER
Calin Baenen | Sciencx - » How do I disable GoLang’s auto-formatting on file save in VSCode?. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/05/13/how-do-i-disable-golangs-auto-formatting-on-file-save-in-vscode/
CHICAGO
" » How do I disable GoLang’s auto-formatting on file save in VSCode?." Calin Baenen | Sciencx - Accessed . https://www.scien.cx/2021/05/13/how-do-i-disable-golangs-auto-formatting-on-file-save-in-vscode/
IEEE
" » How do I disable GoLang’s auto-formatting on file save in VSCode?." Calin Baenen | Sciencx [Online]. Available: https://www.scien.cx/2021/05/13/how-do-i-disable-golangs-auto-formatting-on-file-save-in-vscode/. [Accessed: ]
rf:citation
» How do I disable GoLang’s auto-formatting on file save in VSCode? | Calin Baenen | Sciencx | https://www.scien.cx/2021/05/13/how-do-i-disable-golangs-auto-formatting-on-file-save-in-vscode/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.