Configuring the go language development environment with golang vs Code

Time:2021-12-1

preface

I have talked about the installation of GoLand earlier. Of course, you can also use itVS CodeTo develop.

Vs code is an open source editor of Microsoft. This paper mainly introduces how to use vs code to build the development environment of go language

Downloading and installing vs Code

Official download address: https://code.visualstudio.com/Download

Double click the downloaded installation file to install

Install Chinese Simplified plug-in

Click the last item in the menu bar on the leftManagement extension, inSearch boxMedium inputchinese, select the first item in the result list and clickinstallInstall

After installation, a prompt will appear in the lower right cornerRestart vs CodeAfter restarting, the vs code will display in Chinese

Install go development environment

Click the last item in the menu bar on the leftManagement extension, inSearch boxMedium inputgo, select the first item in the result list and clickinstallInstall

Install go language development kit

During go language development, installing the following plug-ins can provide us with functions such as code prompt, automatic code completion and so on

Under Windows platform, pressCtrl+Shift+p, on MAC, pressCommand+Shift++p, an input box will pop up on the vs code interface. Enter in the input boxgo:install, selectGo:install/Update ToolsAs shown below:

Select Clickdetermine, install

The installation fails in the domestic network environment, as shown in the following figure:

Solution:
Manually download the tool from GitHub. (if Git is installed on the computer)

  1. First in your ownGOPATHofsrcCreate under directorygolang.org/xcatalogue
  2. Open in this directoryterminal / cmd
  3. implementgit clone https://github.com/golang/tools.git toolscommand
  4. implementgit clone https://github.com/golang/lint.gitcommand
  5. Press in vs codeCtrl / Command+Shift+pExecute againgo:install/Update ToolsCommand, select all in the pop-up window and click OK to complete the installation

After the above steps, the installation can be successful

Li peiguan blog

lpgit.com

Recommended Today

Third party components and lazy loading technology for angular performance optimization

catalogue summary Environmental preparation Factors affecting project performance What is lazy loading? Project optimization 1. Division of business modules 2. Create navigation UI 3. Import and route configuration 4. Inside the feature module 5. Confirm that it works normally summary summary Many people should have complained about the performance problems of angular applications. In fact, […]