They can also carry a specific technology or a framework. A module can have an SDK that is different from those configured for a project. Module GOPATH: settings apply only to one module. Project GOPATH: settings apply only to the current project. Global GOPATH: settings apply to all projects of a specific installation of IntelliJ IDEA. You can configure GOPATH for the following scopes: GOPATH Configuring GOPATH for different scopes
#Intellij idea wsl2 download#
Ĭlick OK to close the Download Go SDK dialog.Īs you click Apply or OK on the GOROOT page, IntelliJ IDEA will start downloading and unpacking the Go SDK. To use a file browser, click the Browse icon. In the Location field, specify the path for the SDK. In the file browser, navigate to the SDK version that is on your hard drive.Ĭlick the Add SDK button ( ) and select Download.įrom the Version list, select the SDK version.
![intellij idea wsl2 intellij idea wsl2](https://i.stack.imgur.com/HnImk.png)
Open settings ( Ctrl+Alt+S) and navigate to Languages & Frameworks | Go | GOROOT.Ĭlick the Add SDK button and select Local. If no Go version is available, click the Add SDK button to download a Go version or select a path to a local copy of Go SDK.Įnsure that the provided path to the folder with Go SDK includes bin and src folders. Click the drop-down list and select the Go version. To see the current value of GOROOT, open settings ( Ctrl+Alt+S) and navigate to Languages & Frameworks | Go | GOROOT. a).īin/: location of compiled executable programs built by Go.Ĭonsider the following animation where we change the Go SDK from 1.16.1 to 1.16.3 and assign the project GOPATH to the newly-downloaded SDK directory.
#Intellij idea wsl2 code#
Pkg/: location of compiled package code (for example. Src/: location of Go source code (for example. GOPATH is the root of your workspace and contains the following folders: You can use another directory as your workspace by configuring GOPATH for different scopes. GOPATH stores your code base and all the files that are necessary for your development. By default, the workspace directory is a directory that is named go within your user home directory ( ~/go for Linux and MacOS, %USERPROFILE%/go for Windows). GOPATH is a variable that defines the root of your workspace. You do not need to change this variable, unless you plan to use different Go versions. GOROOT is a variable that defines where your Go SDK is located.
![intellij idea wsl2 intellij idea wsl2](https://media.vlpt.us/images/melonicecream/post/f6b9b4ae-4bd7-420d-b0a1-6a961964f755/image.png)
GOROOT and GOPATH are environment variables that define this layout. And as Apple has been ignoring developers and MacOS itself for the last 5 years, and Linux is still riddled with the same problems it has had for 20 years, the options for developers are becoming less and less.Go tools expect a certain layout of the source code. I've been trying to find a non-Apple solution for a decade, and it just doesn't exist.
#Intellij idea wsl2 windows#
If you're locked to a Windows laptop because of your employee's IT rules, it's better than nothing, but not optimal, and I wonder why people are so excited for WSL2 when VMs that have more features have been around for over a decade. I've used Linux VMs on Windows before - VMWare Workstation has been around for over a decade and has a lot of bells and whistles that make the experience tolerable, but again, the IO is too slow to share Windows and Linux apps between filesystems, so you're basically forced to develop 100% in the VM, IDE included. would grind Jetbrains on Windows to a halt as it simply couldn't sync with the project files on Linux due to slow IO. Trying to use a polyglot project with a bunch of Java, Scala, Go, various plugins like DB views, etc.
![intellij idea wsl2 intellij idea wsl2](https://image.slidesharecdn.com/generalintroductiontointellijidea-130302025915-phpapp01/95/general-introduction-to-intellij-idea-6-638.jpg)
I tried this on WSL1 and it absolutely didn't work for any project larger than the typical Hello World example.