1. Visual Studio Code
1.1. Installation
Download and install the appropriate distribution of Visual Studio Code from Visual Studio Code Download site
1.2. Configuration
-
Ensure your
GOPATHenvironment variable is correctly set. -
Install
gometalinter-
Run
go get -u github.com/alecthomas/gometalinterin your terminal -
Run
gometalinter --installNoteIf you are on Windows,
gometalinter --installmay fail. with a lot of erros aboutcannot find package. If this happens, use the File Explorer to navigate to thesrc/github.com/alecthomas/gometalinter/vendor. Delete thesrcfile, and create a new folder calledsrc. Copy the other folders in thevendorfolder in to thesrcfolder. Rerungometalinter --installin the terminal window.
-
-
Launch Visual Studio Code from a location where your
GOPATHis correctly set. We recommend changing to thesrc\github.com\fabric8-services\fabric8-authdirectory, and executingcode .which will launch VS Code, with the FABRIC8-WIT project open. -
Open any
.gofile by clicking on it. An info dialog box will open at the top of the screen. Click on Show Recommendations and click on the green Install button next to the Go extension fromlukehoban. -
Click the blue Enable button, and then ok to restart Visual Studio Code.
-
On restart, you will notice that a Yellow Analysis Tools Missing warning appears in the status bar. Click it, and then click /Install/ to install the Go tools that Visual Studio Code calls out to in order to provide actions such as refactoring, autocomplete etc.
If you want to read more about using Go with VS Code, check out the plugin README.