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

  1. Ensure your GOPATH environment variable is correctly set.

  2. Install gometalinter

    1. Run go get -u github.com/alecthomas/gometalinter in your terminal

    2. Run gometalinter --install

      Note

      If you are on Windows, gometalinter --install may fail. with a lot of erros about cannot find package. If this happens, use the File Explorer to navigate to the src/github.com/alecthomas/gometalinter/vendor. Delete the src file, and create a new folder called src. Copy the other folders in the vendor folder in to the src folder. Rerun gometalinter --install in the terminal window.

  3. Launch Visual Studio Code from a location where your GOPATH is correctly set. We recommend changing to the src\github.com\fabric8-services\fabric8-auth directory, and executing code . which will launch VS Code, with the FABRIC8-WIT project open.

  4. 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 from lukehoban.

  5. Click the blue Enable button, and then ok to restart Visual Studio Code.

  6. 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.