Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go help exit code 2 #39770

Closed
hellojukay opened this issue Jun 23, 2020 · 2 comments
Closed

go help exit code 2 #39770

hellojukay opened this issue Jun 23, 2020 · 2 comments

Comments

@hellojukay
Copy link

What version of Go are you using (go version)?

go version go1.13.6 linux/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/hellojukay/.cache/go-build"
GOENV="/home/hellojukay/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
components,git-biz.qianxin-inc.cn/ats-ng/nspm-2.0"
GOOS="linux"
GOPATH="/home/hellojukay/go"
GOPROXY="https://goproxy.io"
GOROOT="/home/hellojukay/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/hellojukay/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="0"
GOMOD="/dev/null"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build902988545=/tmp/go-build -gno-record-gcc-switches"

What did you do?

go -h | grep build

What did you expect to see?

it should get help usage about build

	build       compile packages and dependencies
	buildmode   build modes
	cache       build and test caching

What did you see instead?

build golang print usage to stderr,

go -h 
echo $?
2

it thank go -h should exit 0

@davecheney
Copy link
Contributor

The go command returned -2 because -h is not recognised.

@hellojukay
Copy link
Author

yes , go help exit with 0

@golang golang locked and limited conversation to collaborators Jun 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants