Go language Development environment configuration (VSCODE)

Source: Internet
Author: User
Tags install go

Install Go

Slightly

Install Git

Slightly

VS Code Configuration

  • 1. Install the Go extension
    Search for "Go" in the Vscode extension and select Microsoft Official Ms-vscode.go

  • 2. Install the relevant toolkit

    • Installation via Vscode
      The operation is simple, but requires scientific Internet access (see 4th below)
      • 1) Ctrl + Shift + P
      • 2) inputGo: install/update tools
      • 3) all Select, determine
      • 4) Some tools need scientific Internet access. Note Set the [User Settings]http agent for Vscode]:
        For example SSR, please install and complete the SSR client configuration first
        • 4.1) Start the SSR client under Windows, and then set the Vscode:
        "http.proxy": "127.0.0.1:1080",  
        • 4.2) Linux requires the use of a privoxy class of tools, installation configuration Privoxy, and then set Vscode
        "http.proxy": "http://localhost:8118/",  
        Note: Because you want to run the local service, you need to remove the comments in Privoxy/config # forward localhost/ .
        forward           localhost/     .  
    • Manual Installation
      • Use go get, for example:
        go get -u github.com/gin-gonic/gin  
        Some packages need scientific Internet access, can refer to the previous scientific internet instructions
      • Do not want to turn the wall installation method
        # 注意,github下golang/镜像中的包需要放到golang.org/x目录下  git clone https://github.com/golang/net.git $GOPATH/src/golang.org/x/net  git clone https://github.com/golang/sys.git $GOPATH/src/golang.org/x/sys  git clone https://github.com/golang/tools.git $GOPATH/src/golang.org/x/tools  
  • 3. Configuration

    • Set Toolsgopath (" Note: Pit point " in the detailed configuration of the reason reference Vscode Golang)
      In vscode[user Settings], add:
      "go.toolsGopath": "F:\\SourceCode\\go",  
    • Debug Configuration
      Using the default configuration
      For more information on the debug configuration, refer to the official Wiki:debugging Go code using VS code
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.