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
GOPATH
environment variable is correctly set. -
Install
gometalinter
-
Run
go get -u github.com/alecthomas/gometalinter
in your terminal -
Run
gometalinter --install
NoteIf you are on Windows,
gometalinter --install
may 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 thesrc
file, and create a new folder calledsrc
. Copy the other folders in thevendor
folder in to thesrc
folder. Rerungometalinter --install
in the terminal window.
-
-
Launch Visual Studio Code from a location where your
GOPATH
is correctly set. We recommend changing to thesrc\github.com\fabric8-services\fabric8-auth
directory, and executingcode .
which will launch VS Code, with the FABRIC8-WIT project open. -
Open any
.go
file 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.