Skip to content

Conversation

@christothes
Copy link
Member

Sending the -d switch to gofmt makes the build failure output more useful. Rather than just listing the file names that failed format checks, the file diffs will be displayed indicating what needs to be changed. Ex.

gofmt -s -l -d $(find . -name '*.go' -print)
./testcontext.go
diff -u ./testcontext.go.orig ./testcontext.go
--- ./testcontext.go.orig       2021-04-06 13:46:59.500000000 -0500
+++ ./testcontext.go    2021-04-06 13:46:59.500000000 -0500
@@ -34,4 +34,4 @@
 }
 func (c *testContext) Name() string {
        return c.name
-}
+}

@christothes christothes self-assigned this Apr 6, 2021
@christothes christothes added the EngSys This issue is impacting the engineering system. label Apr 6, 2021
@christothes christothes requested review from jhendrixMSFT and removed request for jhendrixMSFT April 16, 2021 18:20
@christothes christothes merged commit 6ad2aaf into Azure:master Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

EngSys This issue is impacting the engineering system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants