As far as I know, the best IDE (as of now) for Go is GoLand. It's a paid IDE, but students and teachers can get a free license.
I'm a big fan of Visual Studio Code, I will use it as much as I can (knowing that it's not the best choice for Go development).
Here, I will describe how to set up VS Code for Go development; as a start, read this tutorial and also this one.
To learn more about your options, read this wiki.
To help you set up quickly, you can download and install a binary release from here.
If you're using Windows and using Chocolatey, you can install Go by running the following command:
choco install golang
To work with Go in Visual Studio Code, you will need to install some extensions.
I've chosen the following ones:
- Go - after installing this extension, please remember to install all the tools (
Ctrl+Shift+P
->Go: Install/Update Tools
), - Go Test Explorer,
- Go Auto Struct Tag,
- Go Outliner,
- Go Doc,
- Protobuf (Protocol Buffers).
You'll find more customizations I've made to my VS Code setup here.
You should perform the following steps to format your code automatically (on save).
Add the following settings to your settings.json
:
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.formatOnSave": true
}