Lint on Save With VS Code Official Golang Extension
The post Lint on Save With VS Code Official Golang Extension appeared first on Qvault . Go has hard opinions about how you should style and format your code. The big upside of this is that you don’t need to spend hours setting up tools like ESLint, Prettier, JSLint, etc. That said, in order to take advantage of the styling and listing tools available in the toolchain, you need a dev environment that makes them easy to use. VS Code – Lint on save I’m currently a VS Code fan. I don’t like to think about code styling. I like to type a bunch of code with incorrect spacing and press (ctrl+s) or (cmd+s) to save my code and auto-format it. First, make sure you have the latest version of Go installed on your machine (as of time of writing, 1.14) Next install the Official Golang VS Code Plugin Next open your settings.json file in VS Code. These settings can be specific to in a single project, workspace or your entire machine. Add the following settings: { "go.lintOnSave...