Golang+litide+ubuntu Environment Configuration

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

1. Download the package

Recommended URL http://www.golangtc.com/(golang China), download speed is relatively fast.

I downloaded the package

Golang ide:liteidex27.2.1.linux-64-qt4.tar.bz2

Golang:go1.4.2.linux-amd64.tar.gz

Download it according to your needs.

2. Unpack the Package

TAR-JXVF liteidex27.2.1.linux-64-qt4.tar.bz2-c/usr/local

TAR-JXVG go1.4.2.linux-amd64.tar.gz-c/usr/local

Note:-c Specifies the unzip directory

3. Configure Environment variables

Modify the/etc/profile file

$sudo Vim/etc/profile

Add content as follows:

#go Configuration
Export path= $PATH:/usr/local/go/bin (add go/bin directory in PATH environment variable because go is installed in/usr/local directory, so add directory to/usr/local/go/bin)

Export Goroot=/usr/local/go (Similarly, this path is the install directory for Go)

Export Gopath=/home/mxg/go_code (this path is based on your own personal designation, the Go program needs to be compiled in this directory)

saving files, updating environment variables

$source/etc/profile

Check environment variables

$echo $GOROOT

$echo $PATH

$echo $GOPATH

Configured correctly there will be content display


4. Running Hello.go

Write Hello.go in Gopath

$go Bulid Hello.go

$./hello (executable file name generated)

$ Hello world!


5, Liteide environment configuration, the principle of the same, no longer repeat.


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

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.