How vscode configures the go language development environment
Install Go development extension
Now we need to install the Go extension plug-in for our VS Code editor, let It supports Go language development.
Install Go language development tool kit
Press Ctrl Shift P on Windows platform and press Ctrl Shift P on Mac platform Command Shift P. At this time, an input box will pop up on the VS Code interface, as shown below:
Enter >go:install in this input box, and the following will automatically search for related information. command, we select the command Go:Install/Update Tools
and select it and press Enter to execute the command (or click the mouse with the Command)
Then click the "OK" button to install. The following input window will pop up:
VS Code will download and install the 16 tools listed above at this time. However, due to the domestic network environment, the installation will basically fail, as shown in the following FAILED:
Solution: Use git to download the source code and then install it
We can manually download the tool from github, (To perform this step, you need to have git installed on your computer)
Step one: Now create the golang.org/x directory under the src directory of your GOPATH
Step two: In the terminal/cmd, cd to the GOPATH/src/golang.org/x directory
Step 3: Execute the git clone https://github.com/golang/tools.git tools command
Step 4: Execute the git clone https://github.com/golang/lint.git command
Step 5: Press Ctrl/Command Shift P and execute the Go:Install/Update Tools command again, Select them all in the pop-up window and click OK. This time the installation will be SUCCESSED.
After following the above steps, the installation can be successful. At this time, when you create a Go file, you can use code prompts, code formatting and other tools normally.
Configuring automatic saving
Click Preferences->Settings. When you open the settings page, you can see the relevant configuration of automatic saving as shown in the figure. You can choose the automatic saving method according to your own preferences:
Configure code snippet shortcut keys
or Press Ctrl/Command Shift P, enter >snippets as shown below, select the command and execute it:
The above is the detailed content of How vscode configures the go language development environment. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

1. First, open the settings option in the settings menu. 2. Then, find the terminal column in the commonly used page. 3. Finally, uncheck the usewslprofiles button on the right side of the column.

1. First, after opening the editing window, click the configuration icon in the lower left corner 2. Then, click the Manage Workspace Trust button in the submenu that opens 3. Then, find the page in the editing window 4. Finally, according to your office Just check the relevant instructions if required

1. First, use vscode software to write an html program. 2. Then, click the search button and enter openinbrowser. 3. After the installation is complete, you need to restart the software, then right-click on the HTML document and select openindefaultbrowser in the drop-down menu. 4. Finally, the software will open with the default browser.

1. First, click to open the settings option in the More menu. 2. Then, find the terminal column under the Features section. 3. Finally, on the right side of the column, click the enableanimation button with the mouse and save the settings.

Step 1: After opening the vscode software interface, click the settings button in the settings menu below. Step 2: Find the Git option under the Extensions column. Step 3: Click to check the enablesmartcommit button.

1. After opening the interface, click the mouse to select an item that needs to be deleted. 2. Find the close folder option in the file menu in the upper left corner. 3. Finally, find the specific location of the file in the document and right-click to delete it.

In Go, WebSocket messages can be sent using the gorilla/websocket package. Specific steps: Establish a WebSocket connection. Send a text message: Call WriteMessage(websocket.TextMessage,[]byte("Message")). Send a binary message: call WriteMessage(websocket.BinaryMessage,[]byte{1,2,3}).

First, download the vscode software package, unzip it, run [exe. file], double-click to open, enter the installation wizard, read the agreement, click I agree, click Next, then select the installation location, the default is C drive, click Next, then select Start Menu folder, click Next to select additional tasks, click Next to prepare for installation, click Install. Installing, wait patiently. Finally, the installation is complete, click Finish, and exit the installation wizard.
