Install Go lang under MacOS

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

1. Download the installation package

Because the official website was wall, so to a domestic go forum download: Click to enter the download

After downloading, double-click to install.

2. Configure Environment variables

GOROOT :gol aNgAnninstalledMeshRecord Gopath:go lang working directory, kind of like eclipse.

Start configuration below
Enter the following command into the terminal:

vim ~/.bash# 打开环境变量配置

At the bottom of the add

export GOPATH=/Users/# 改成你喜欢的路径export# 默认安装都市这个路径

When you are finished adding, exit vim
Enter the following command into the terminal:

source# 让环境变量配置生效

When you are finished, create a new three folder in the $gopath directory

bin:存放编译后的可执行文件;pkg:存放编译后的包文件;src:存放项目源文件;

Finally, enter the following command into the terminal to verify that the installation was successful:

version


A similar image appears to be successful, if not successful, please check your environment variable configuration.

3.IDE

I. Sublime Text (personal preference)
After installing the Sublimetext, install the plug-in manager, go to the plug-In Manager installation, enter Gosublime, go to install
After the installation is complete, you will also install a syntax hint plugin:
Enter the command into the terminal:

go get github.com/nsf/gocodego install github.com/nsf/gocode

Two. Liteide
Download Address: Liteide


Download one of the
Unzip is available

Three. Wide
Project Address: Wide Project
Official Address: Official website
After downloading, use go to run, in the browser to open the specified IP and port can be used (for details, please refer to the official website)

4. Learn Go lang

    • Official tutorial: Skip the Wall
    • Go Language Chinese Web: Go language Chinese web
    • Golang China: Golang China
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.