zoukankan      html  css  js  c++  java
  • mac home brew install go

    mac利器home brew安装Go

    首先你得需要安装home brew和ruby环境(因为home brew依赖ruby) 

    如果没有请自行到链接安装

    准备好之后就开始安装go

    brew update && brew upgrade
    brew install git
    brew install mercurial
    brew install go

    安转go之后还需要配置环境变量

    vim ~/.bash_profile  or vim ~/.bash_profile
    #GOROOT
    export GOROOT=/usr/local/Cellar/go/1.7.4/libexec
    
    #GOPATH
    export GOPATH=$HOME/GoLang
    
    #GOPATH bin
    export PATH=$PATH:$GOPATH/bin
    
    #GOPATH root bin
    export PATH=$PATH:$GOROOT/bin
    source ~/.bash_profile or source ~/.bash_profile

    ok go环境配置完毕,接下来输入go env即可看到go的详细信息

    bogon:~ faunjoe$ go env
    GOARCH="amd64"
    GOBIN=""
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/faunjoe/work/go"
    GORACE=""
    GOROOT="/usr/local/Cellar/go/1.9/libexec"
    GOTOOLDIR="/usr/local/Cellar/go/1.9/libexec/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/x4/zr94mx8s1n35ysp_rcl6dk7m0000gn/T/go-build768068792=/tmp/go-build -gno-record-gcc-switches -fno-common"
    CXX="clang++"
    CGO_ENABLED="1"
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
  • 相关阅读:
    LeetCode 12. Integer to Roman
    个人博客09
    个人博客08
    人机交互之我的输入法
    学习进度条(第六周)
    《梦断代码》阅读笔记02
    个人博客07
    学习进度条(第五周)
    个人博客06
    个人博客05
  • 原文地址:https://www.cnblogs.com/faunjoe88/p/7457882.html
Copyright © 2011-2022 走看看