Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install and use VS Code of GE language integrated development environment

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "how to install and use VS Code of Go Language Integrated Development Environment". In daily operation, I believe many people have doubts about how to install and use VS Code of Go Language Integrated Development Environment. I have consulted all kinds of materials and sorted out simple and easy operation methods. I hope to answer your doubts about "how to install and use VS Code of Go Language Integrated Development Environment"! Next, please follow the small series to learn together!

directory

Go Integrated Development Environment VS Code Installation

download and installation

Install Chinese Simplified Plugin

Install Go Development Extension

Change Editor Theme

Install Go Development Kit

Configure VSCode to enable auto-save

Configure snippet shortcuts

Go Integrated Development Environment VS Code Installation

VS Code is an open source Microsoft editor, plug-in system is very rich. Here is how to build a go language development environment with VS Code

download and installation

VS Code official download address

Three major platforms are supported, please select the corresponding installation package according to your computer platform.

Double-click the downloaded installation file, double-click to install.

Install Chinese Simplified Plugin

Click on the last item in the left menu bar to manage extensions, enter chinese in the search box, select the first item in the results list, and click install.

After installation, the bottom right corner will prompt restart VS Code. After restart, your VS Code will display Chinese

Install Go Development Extension

Now we're going to install the Go extension for our VS Code editor to support Go development.

Change Editor Theme

Click Settings-> Color Theme,

You can choose the theme according to your preferences.

Install Go Development Kit

Go provides us with features such as code hinting and code completion when we develop it.

Before this, please set GOPROXY, open the terminal and execute the following command:

go env -w GOPROXY=https://goproxy.cn,direct

Press Ctrl+Shift+P on Windows platform and Command+Shift+P on Mac platform. At this time, an input box will pop up in VS Code interface, as shown below:

We type>go:install in this input box, the following will automatically search for related commands, we choose Go:Install/Update Tools this command, press the following figure to select and enter to execute the command (or use the mouse to click on the command)

The following window will pop up to start installing the tool:

Drink some water and wait for all tools to be installed successfully, as shown below:

Configure VSCode to enable auto-save

Click File-> Preferences-> Settings as shown below,

Configure snippet shortcuts

Or press Ctrl/Command+Shift+P, press Enter>snippets, select the command and execute:

Then in the pop-up window click Select Go option:

You can simply look at the comments above, which introduce the main usage:

"Put a name here":{ "prefix": "this is a shortcut key", "body": "here is the code fragment inserted by pressing the shortcut key", "description": "description of the prompt message is placed here"}

where $0 represents the final cursor retention position. For example, I created two shortcuts here, one for pln to insert fmt. Printf ("") code into the editor, and plf to insert fmt.Printf("") code.

{ "println":{ "prefix": "pln", "body":"fmt.Println($0)", "description": "println" }, "printf":{ "prefix": "plf", "body": "fmt.Printf(\"$0\")", "description": "printf" }}

Paste the above code into the configuration file, save and close the configuration file.

At this stage, programmers will dominate, even more than before.

At this point, the study of "how to install and use VS Code of Go Language Integrated Development Environment" is over, hoping to solve everyone's doubts. Theory and practice can better match to help everyone learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report