如题,本人在Mac上安装Anaconda后,bash_profile里只有anaconda,没有go环境变量,在终端查看go env 显示:
GO111MODULE="";
GOARCH="amd64";
GOBIN="";
GOCACHE="/Users/eric/Library/Caches/go-build";
GOENV="/Users/eric/Library/Application Support/go/env";
GOEXE="";
GOFLAGS="";
GOHOSTARCH="amd64";
GOHOSTOS="darwin";
GONOPROXY="";
GONOSUMDB="";
GOOS="darwin";
GOPATH="/Users/eric/go";
GOPRIVATE="";
GOPROXY="https://proxy.golang.org,direct";
GOROOT="/usr/local/go";
GOSUMDB="sum.golang.org";
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64";
GCCGO="gccgo";
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/64/ztxkzk7138dgyhzfzxr8th740000gn/T/go-build377719175=/tmp/go-build -gno-record-gcc-switches -fno-common"
bash_profile:# added by Anaconda3 2019.07 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/eric/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/eric/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/eric/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/eric/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
有疑问加站长微信联系(非本文作者)