-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.14.2 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env)?
go env Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="~/.cache/go-build" GOENV="~/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="~/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/lib/go/go-latest" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/lib/go/go-latest/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="~/go/path/to/project/go.mod" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build335622656=/tmp/go-build -gno-record-gcc-switches"
What did you do?
This is more of a feature request (or question) rather than bug reporting. I'm trying to check formatting of go files with goimports which works as expected, but if there's any offensive file it always exit with code 0. As a result I need to hack around with tee and similar tools to manually fail my make checkfmt target on CI.
I was wondering if this was by design or any specific reasons not to return non-zero exit code on list (-l). I briefly looked around and it seems there might be a really easy way to add this, something like adding:
if *list {
fmt.Fprintln(out, filename)
+ exitCode = 1 # or any other reasonable exit code
}right after line 156, here:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.