Linux (CentOS 7.2) Deployment Golang Operating Environment

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

Guide

The Go language, also known as Golang, is an open-source programming language originally developed by Google, which is designed to follow the 3 principles of simplicity, security, and speed. The go language has a variety of debugging, testing, analysis, and code review tools, and now the go language and tools are available in the source library of most Linux distributions, and I'll show you how to install the Go language for Linux.

Installation

First look at whether CentOS is 64-bit or 32-bit, which shows that 64 is 64 bits:

getconf LONG_BIT

Then download the go-linux-64-bit source package, manual wget installation, not recommended Yum installation (now the latest version is 1.8, the latest version of the Yum Warehouse is only 1.4).

wget http://www.golangtc.com/static/go/1.8/go1.8.linux-amd64.tar.gz

Unzip the binaries to the/usr/local directory

sudo tar -xzf go1.8.linux-amd64.tar.gz -C /usr/local

Use VI to add the following in the environment variable configuration file/etc/profile:

vi /etc/profile 或者 vi $HOME/.profile

Add in:

# GO PATHexport PATH=$PATH:/usr/local/go/bin# GO GOPATHexport GOPATH=/home/golang

Make the profile configuration effective immediately:

source $HOME/.profile

View go version or environment variables

go version #查看go版本
go env #查看go环境变量

Complete. You can see the Gopath directory as /home/golang/.

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.