Go Language Development Tools
VSCode
VSCode installation tutorial can be found at: https://www.tutorialpro.org/w3cnote/vscode-tutorial.html
Then we open the VSCode extensions (Ctrl+Shift+P
):
Search for go
:
Click to install, and after installation, we can use code completion, testing, debugging, and other features.
GoLand
GoLand is a Go language IDE from the Jetbrains family, with a 30-day free trial period.
Installation is straightforward; visit the Goland download page and download the appropriate software for your current system environment (Mac, Linux, Windows).
LiteIDE
LiteIDE is an open-source, cross-platform, lightweight Go language integrated development environment (IDE).
Supported Operating Systems
- Windows x86 (32-bit or 64-bit)
- Linux x86 (32-bit or 64-bit)
Download link: http://sourceforge.net/projects/liteide/files/
Source code link: https://github.com/visualfc/liteide
Eclipse
Eclipse is also a commonly used development tool. The following describes how to use Eclipse to write Go programs.
Eclipse main interface for editing Go:
- First, download and install Eclipse
- Download the goclipse plugin https://github.com/GoClipse/goclipse/blob/latest/documentation/Installation.md#installation
Download gocode for Go code completion hints:
gocode GitHub address:
https://github.com/nsf/gocode
On Windows, install git, typically using msysgit.
Then install via cmd:
go get -u github.com/nsf/gocode
Alternatively, download the code and compile 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 up some basic Go information
(2) Configure Gocode (optional, for code completion), set the Gocode path to the previously generated gocode.exe
file
Set up Gocode information
(3) Configure GDB (optional, for debugging), set the GDB path to the gdb.exe
file in the MinGW installation directory
Set up GDB information
- Test if successful
Create a new Go project and then create a hello.go
. As shown below:
New project, edit file
Debug as follows (use commands in the console for debugging):
Figure 1.16 Debugging Go Program