Home > Backend Development > Golang > How to view environment information in go language

How to view environment information in go language

Release: 2019-11-28 15:30:54
forward
4663 people have browsed it

How to view environment information in go language

Go languageThe development environment depends on some operating system environment variables. Here are some of the most important environment variables:

GOROOT means Go is in The installation location on your computer is usually $HOME/go. Of course, you can also install it elsewhere.

GOARCH represents the processor architecture of the target machine, its value can be 386, amd64 or arm.

GOOS represents the operating system of the target machine, its value can be darwin, freebsd, linux or windows.

We can view the environment information of go through the go env command

$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/lvhy/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/lvhy/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/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/2w/tt1p_4td3yq9xlbl7c2t4jn00000gn/T/go-build878610085=/tmp/go-build -gno-record-gcc-switches -fno-common"
Copy after login

The above is the detailed content of How to view environment information in go language. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template