How to develop Golang in vscode? The following article will introduce you to the method of configuring and building the Golang development environment in vscode through pictures and texts. I hope it will be helpful to you!
Download the Go installation package, address: Go Language Chinese Network (https://studygolang.com/dl), the directory after the installation is completed is as follows:
Check the current version through the command line:
[Related recommendations: Go video tutorial]
Configure environment variables and create two new environment variables, as follows:
#For configurations on other platforms, please refer to the goproxy official website.
Open vscode, install a Go plug-in, as follows:
Then open a folder and create a hello.go file. At this time, you will be prompted to install the corresponding application in the lower right corner. Select Install All and wait for installation. A successful installation is as follows:
The environment is now set up. [Recommended learning: "vscode introductory tutorial"]
Write the go program in the hello.go file
package main import "fmt" func main() { fmt.Println("hello World") }
Execute the following command in the terminal, and the go.mod file will be generated
go mod init gitee.com/mall_lucy/my_go_studycode
Then run hello.go in the terminal, as follows :
For more programming-related knowledge, please visit: Programming Video! !
The above is the detailed content of How to develop Golang in VSCode? Introduction to development environment configuration. For more information, please follow other related articles on the PHP Chinese website!