Vscode installs go plug-ins and language development packages

Time:2022-4-26

Vscode installation process of go plug-in and language installation package, if there is no go environment and vscode, you can install go and vscode first. The next steps are mainly to install go plug-ins and language development packages through vscode plug-ins

Vscode install go plugin

Start vscode select plug-in – > search go select go for visual studio code plug-in and click Install. As shown in the figure:
Vscode installs go plug-ins and language development packages

Vscode install go language development kit

When developing go language, it provides us with functions such as code prompt, automatic code completion and so on.

Press Ctrl + Shift + P for Windows platform and Command + Shift + P for Mac platform. At this time, an input box will pop up in the vs code interface, as shown in the following figure:
Vscode installs go plug-ins and language development packages
Enter > go: install in this input box, and relevant commands will be searched automatically. We choose go: Install / update tools
Vscode installs go plug-ins and language development packages
Select and enter to execute the command (or click the command with the mouse)
Vscode installs go plug-ins and language development packages

Due to network reasons, there will be errors in this download process.

Solution:

Modify go environment parameter configuration

1、GO111MODULE
2、GOPROXY

go env -w GO111MODULE=on
go env -w GOPROXY= https://goproxy.cn #Set agent as domestic source

Check whether the environment is configured successfully

go env

Vscode installs go plug-ins and language development packages

Then continue the operation of vscode plug-in. The successful output is as follows:
Vscode installs go plug-ins and language development packages

Recommended Today

Start with Hotspot source code from Thread.start

native start0 is traced to the hotspot source code private void native start0(); The principle of native is to call JNI, and the convention of Hotspot source code is, usually one Xxx.java corresponds to one Xxx.c, Here are three examples: Java class Path relative to the OpenJDK source java.lang.Thread jdk/src/share/native/java/lang/Thread.c java.lang.String jdk/src/share/native/java/lang/String.c java.lang.System jdk/src/share/native/java/lang/System.c So […]