]> Cypherpunks repositories - gostls13.git/commit
cmd/gofmt: change -d to exit 1 if diffs exist
authorRobbie McMichael <robbie.mcmichael.git@gmail.com>
Mon, 6 Oct 2025 12:47:34 +0000 (12:47 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 8 Oct 2025 20:56:57 +0000 (13:56 -0700)
commitd945600d060e7a0b7c5e72ac606a017d105a17f3
treeadc55bf4086ddc471981fbf289dd2331608363c1
parentd4830c61301a32ad9373bc30c5fd6196c3567f61
cmd/gofmt: change -d to exit 1 if diffs exist

When using the -d flag, set the exit code to 1 if there is a diff.

Fixes #46289

Change-Id: I802e8ccd1798ed7f4448696bec4bc82835ec71a2
GitHub-Last-Rev: db2207fba9a8f7a2f50138ec1f086ac6a74e1b10
GitHub-Pull-Request: golang/go#75649
Reviewed-on: https://go-review.googlesource.com/c/go/+/707635
Reviewed-by: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Auto-Submit: Sean Liao <sean@liao.dev>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/gofmt/gofmt.go
src/cmd/gofmt/gofmt_test.go
src/cmd/gofmt/testdata/exitcode.golden [new file with mode: 0644]
src/cmd/gofmt/testdata/exitcode.input [new file with mode: 0644]