Home > Development Tools > VSCode > body text

How to develop Golang in VSCode? Introduction to development environment configuration

青灯夜游
Release: 2022-02-18 20:03:48
forward
2898 people have browsed it

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!

How to develop Golang in VSCode? Introduction to development environment configuration

Build the Golang development environment in vscode

The first step

Download the Go installation package, address: Go Language Chinese Network (https://studygolang.com/dl), the directory after the installation is completed is as follows:

How to develop Golang in VSCode? Introduction to development environment configuration

Check the current version through the command line:

How to develop Golang in VSCode? Introduction to development environment configuration

[Related recommendations: Go video tutorial]

Second step

Configure environment variables and create two new environment variables, as follows:

How to develop Golang in VSCode? Introduction to development environment configuration

#For configurations on other platforms, please refer to the goproxy official website.

The third step

Open vscode, install a Go plug-in, as follows:

How to develop Golang in VSCode? Introduction to development environment configuration

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:

How to develop Golang in VSCode? Introduction to development environment configuration

How to develop Golang in VSCode? Introduction to development environment configuration

The environment is now set up. [Recommended learning: "vscode introductory tutorial"]

Step 4

Write the go program in the hello.go file

package main

import "fmt"

func main() {
	fmt.Println("hello World")
}
Copy after login

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
Copy after login

How to develop Golang in VSCode? Introduction to development environment configuration

Then run hello.go in the terminal, as follows :

How to develop Golang in VSCode? Introduction to development environment configuration

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!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!