Ubuntu/elementary OS vscode configuration Go development environment

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

        • Install Go
        • Configuring Environment variables
        • Set permissions
        • Set Gopath
        • Install Vscode Go
        • Installing delve

Install Go

Select the installation package (. tar.gz file) that matches your system from the download address, my Elemenray OS 32 bit, I chose go1.6.linux-386.tar.gz
After downloading, cd go to the download directory and use the command

-xzf go1.6.linux-386.tar.-C /usr/local

Most of the methods on the Internet are extracted to /usr/local/ , but I myself in the back Vscode install the Go plugin often encountered a permission error, causing the plug-in cannot be installed, so it is recommended to install under the user home directory

sudo tar -xzf go1.6.linux-386.tar.gz -C /home/kingeasternsun

Configuring Environment variables

Configure the environment variables of Ubuntu, I want the global user to be able to use, so Modified "/etc/profile", at the end of this file to add the following content:

export GOROOT=/home/kingeasternsun/goexport GOBIN=/home/kingeasternsun/go/binexport PATH=$PATH:$GOBINexport GOPATH=/home/kingeasternsun/goproject

Set permissions

This is for the go language decompression to the /usr/local use of
To ensure that Vscode installs the Go plugin successfully, set the following

chmod777 /usr/local/go/bin

Set Gopath

Vscode Install go plugin will prompt Gopath not set error, then open Launch.json in the inside Env set

Install Vscode Go

Search for Go in the Vscode App Store and click Install.

Installing delve

Vscode prompt for the following error

Delve only supports 64-bit!!!
Refer to the following https://github.com/derekparker/delve/issues/514

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.