

The future of WSL integration with GoLandĪs you can see in this post, some of the workflows that you might be used are not yet available.
GOLANGCI LINT GOLAND PRO
Pro tip: If you wish to change this for all new projects, go to File | New Project Settings | Settings for New Projects | Tools | Terminal and make the same selection there. We can have WSL come up by default, by using File | Settings | Tools | Terminal and changing the Shell path property from the default to wsl.exe.Īfter that, invoking the Terminal will bring up WSL by default for the project. Using WSL as the default Terminal in the IDE Note: At the moment WSL 1 does not support the necessary APIs for Delve to work, so debugging will not be possible for applications running under WSL. Note: The Working directory will set the working directory of WSL, which will also be the working directory of the application. To do this, head over to File | Settings | Keymap and search for WSL, and then assign the desired shortcuts to both tools. Pro tip: External tools can have individual shortcuts. As such, our configuration will look like this: That is where Go’s property of building a binary with the same name as the parent directory of the file with the main() function comes in handy. This assumes that Go is installed under the default location inside WSL, but if not, you should adjust it accordingly.įor the second external tool, we’ll want to configure it to run our compiled application. We will name the first one WSL "go build".We’ll set Program to "wsl", the Arguments to "/usr/local/go/bin/go build" (without the quotation marks), and finally, the Working directory to $FileDir$, and then we click the OK button. Go to File | Settings | Tools | External Tools and then click the + button to add two different tools. We’ll need to configure a couple of External Tools and make them generic for us to allow us to run them in different projects. Running an application under WSL is a bit more complex as we can’t use the regular tooling anymore. Note: This is important for projects using Go Modules because the caching for Modules dependencies is under GOPATH/pkg/mod by default.Īs mentioned before, the IDE configuration will point to the Window Go installation, so that it can resolve the Go SDK dependencies, fetch dependencies, and so on. This will allow us to have the project/dependencies in a single place. Make sure to point the GOPATH both in Windows and Linux to the same directory. With these two Go installations in place, some additional configuration is needed.
GOLANGCI LINT GOLAND INSTALL
You should also install Go for Windows since the IDE will still run on the Windows side of things. We are going to have a look at WSL 1 since, as of the publishing of this article, WSL 2 is not officially released yet.Īfter installing WSL 1, and enabling your preferred Linux distribution on it, you can set up Go as you would on a normal Linux installation.
GOLANGCI LINT GOLAND WINDOWS 10
Windows Subsystem for Linux, or WSL as it’s commonly known, allows Windows 10 to run Linux inside Windows. We released an EAP version for a seamless integration of this feature, see
