Use Vscode to go posture

Source: Internet
Author: User

Statement, I am also a variety of information to make this, found that the error will be updated in time this article
First of all, about the wall, please bring your own ladder or something ...
Second, here's a description of why the ladder has no way to proxy cmd
Finally, we start to configure the environment

Vscode expansion plug-in installation

    • Extended Store Search Go General installation The first one is right, the extension is calledGo
    • Configure the Go configuration file
      • Files-Preferences-settings-user settings, copying the following to user settings, or individually configurable in workspace settingsgopath
    // golang配置    "go.formatTool": "goreturns",    "go.goroot": "D:/Go",    "go.gopath": "${workspaceRoot}"
    • After the configuration is complete Vscode should be prompted to install the plugin, click Install all on the line
    • Normally there will be a lot of installation failures, when we need to manually go to GitHub to download

Manually go to GitHub to download tools

First, close the Vscode
Second, get your git ready and switch to%GOPATH%\src\github.com\golang\
Finally, the relevant reference articles are as follows:
Let you successfully install the relevant plugins for go in Vscode
Git error Collection

    • Execute Clone command
git clone https://github.com/golang/tools.git tools
    • Copy tools directory to%GOPATH%\src\golang.org\x\
# git bash 中的操作,需提前建立目录cp  -r tools/ ../../golang.org/x/
    • Copy %GOPATH%\src\github.com\golang\ the lint folder under the %GOPATH%\src\golang.org\x\ directory
      Do not copy will be in the installation of the report can not find errors, as follows:
      = = Do not know why this error is reported, anyway, copy the past to solve
E:\GoProjects\go_study>go install github.com\golang\lint\golintsrc\github.com\golang\lint\golint\golint.go:19:2: cannot find package "golang.org/x/lint" in any of:        D:\Go\src\golang.org\x\lint (from $GOROOT)        E:\GoProjects\go_study\src\golang.org\x\lint (from $GOPATH)# 复制过去之后手动执行这个命令安装就行E:\GoProjects\go_study>go install github.com\golang\lint\golint
    • Re-open your Vscode, you will also be prompted to install a plug-in not installed successfully, this time still click Install all plug-ins, and then wait for the installation to complete ...

Not finished ... Find errors and issues that will update this article in a timely manner

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.