There are many IDEs supporting golang since it is static-type, e.g., VSCode/IDEA/GoLand.
Theoretically, any IDE which supports standard vendor mechanism can integrate Gogradle.
Steps to integrate Gogradle with IDE:
- Install IDE
- Run
gradlew goVendor
to install all dependencies to vendor - Run
gradlew showGopathGoroot
orgradlew sGG
to printGOPATH
andGOROOT
of your project - Configure your IDE with
GOROOT
andGOPATH
above - Start work!
Attention: although it's supported by Gogradle to put your project at any place, some IDEs can't support this scenario fully. Therefore, it's highly recommended to conform Go's GOPATH convention and place your project at corresponding location when using an IDE.
At first, you need to have IDE and Golang plugin installed.
Click the corresponding link and download your favorite IDE.
On IntelliJ IDEA/WebStorm/PhpStorm/PyCharm/RubyMine/CLion, go-lang-idea-plugin is required。
On Mac:
Preferences > plugins > Browse Repositories > Search for 'Go' and install
On Windows:
File > Settings > Plugins > Browse Repositories > Search for 'Go' and install
And VSCode needs vscode-go。
Search Go
and install the plugin as documented here.
On Vim, vim-go is required, just follow the documentation.
Check your Java version with java -version
. Gogradle requires JRE 8+, so update it if necessary.
Fortunately, there are JREs shipped with JetBrains IDE, which you can use without extra installation.
On Mac, it is located in
/Applications/<PRODUCT>.app/Contents/jdk/Contents/Home/jre
Where <PRODUCT>
can be IntelliJ IDEA/GoLand/WebStorm/PhpStorm/PyCharm/RubyMine/CLion
On Windows, it is located in
<INSTALLATION PATH OF IDE>/jre/jre
Set your environment variable JAVA_HOME
to it and that's it!