Go Development Tools
VSCode
For the VSCode installation tutorial, see:https://www.runoob.com/w3cnote/vscode-tutorial.html
Then we open VSCode's extensions (Ctrl+Shift+P):

Search for go:

Click install; once installation is complete, we can use features such as code completion, testing, and debugging.

GoLand
GoLand is a Go IDE from the JetBrains family, with a 30-day free trial.
Installation is also simple; visit the GoLand download page, and download the appropriate software for your current system among the three major platforms (Mac, Linux, Windows).

LiteIDE
LiteIDE is an open-source, cross-platform, lightweight Go integrated development environment (IDE).
Supported operating systems
- Windows x86 (32-bit or 64-bit)
- Linux x86 (32-bit or 64-bit)
Download address:http://sourceforge.net/projects/liteide/files/
Source code address:https://github.com/visualfc/liteide
Eclipse
Eclipse is also a very commonly used development tool; the following describes how to use Eclipse to write Go programs.
The main interface of Eclipse for editing Go
- First, download and install Eclipse
- Download goclipse Plugin https://github.com/GoClipse/goclipse/blob/latest/documentation/Installation.md#installation
-
Download gocode, used for Go code completion
The GitHub address of gocode:
https://github.com/nsf/gocode
On Windows, to install git, usually use msysgit。
then install under cmd:
go get -u github.com/nsf/gocode
Alternatively, you can download the code and compile it directly with go build, which will generate gocode.exe
- Download MinGW and install it as required
- Configure the plugin
Windows->Reference->Go
(1) Configure the Go compiler
Set some basic information for Go
(2) Configure Gocode (optional, for code completion); set the Gocode path to the previously generated gocode.exe file
Set gocode information
(3) Configure GDB (optional, for debugging); set the GDB path to the gdb.exe file in the MingW installation directory
Set GDB information
-
Test whether it was successful
Create a new Go project, then create a hello.go. As shown below:
Create a new project and edit the file
Debug as follows (you need to debug by entering commands in the console):
Figure 1.16 Debugging a Go program