请问:在mac上用brew安装完go,还没有设置GOPATH,但是用命令go env查看,发现已经设置了GOPATH的全局变量。
======以下是代码运行结果=====
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/Lily/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/Lily/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
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/z0/lgty6nw56zx7kyf11cx6wxw40000gp/T/go-build829410979=/tmp/go-build -gno-record-gcc-switches -fno-common"
==============================
GOPATH="/Users/Lily/go"
请问,安装完go,是默认都设置了GOPATH了吗?
我看过家目录,里面并没有go的目录。请问怎么回事?
我在终端窗口输入:echo $GOPATH ,为什么显示是空呢?还不是 /Users/Lily/go
谢谢
有疑问加站长微信联系(非本文作者)