Configuring the Golang environment with homebrew installation

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

Installing homebrew

In the Homebrew copy installation command, run complete installation in the console

Installing Golnag

$ brew update && brew upgrade$ brew install go

Path configuration

Create a directory as a directory, gopath create three directories, bin srcpkg

$ cd ~$ vim .bash_profile

Edit .bash_profile the file and save it with the following contents

export GOROOT=/usr/local/opt/go/libexec# GOPAT为上面创建的目录路径export GOPATH=/Users/deweixu/coding/Go/go_pathexport PATH=$PATH:$GOROOT/bin:$GOPATH/bin

Run source .bash_profile to make the configuration PATH effective.

Installation Complete

Run to go env view the installation effect:

$ go envGOARCH="amd64"GOBIN=""GOEXE=""GOHOSTARCH="amd64"GOHOSTOS="darwin"GOOS="darwin"GOPATH="/Users/deweixu/coding/Go/go_path"GORACE=""GOROOT="/usr/local/opt/go/libexec"GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"CC="clang"GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/q3/kxp92gk548z_y9pc1n3qsztw0000gn/T/go-build078494854=/tmp/go-build -gno-record-gcc-switches -fno-common"CXX="clang++"CGO_ENABLED="1"

enjoy 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.