diff options
author | Dmitri Shuralyov <dmitshur@golang.org> | 2021-08-09 20:29:14 -0400 |
---|---|---|
committer | Dmitri Shuralyov <dmitshur@golang.org> | 2021-08-13 20:45:17 +0000 |
commit | 98f3d7fecbb8a9074f5f4ffc50bb016e194940b7 (patch) | |
tree | 8df9912af4753b4127056f5acdf7730bd3fa16ce /src/cmd/compile/internal/noder | |
parent | 20a620fd9f7bc35739c1af3602d53808d0430814 (diff) | |
download | go-98f3d7fecbb8a9074f5f4ffc50bb016e194940b7.tar.gz go-98f3d7fecbb8a9074f5f4ffc50bb016e194940b7.zip |
all: gofmt more (but vendor, testdata, and top-level test directories)
CL 294430 made packages in std and cmd modules use Go 1.17 gofmt format,
adding //go:build lines. This change applies the same formatting to some
more packages that 'go fmt' missed (e.g., syscall/js, runtime/msan), and
everything else that is easy and safe to modify in bulk.
Consider the top-level test directory, testdata, and vendor directories
out of scope, since there are many files that don't follow strict gofmt
formatting, often for intentional and legitimate reasons (testing gofmt
itself, invalid Go programs that shouldn't crash the compiler, etc.).
That makes it easy and safe to gofmt -w the .go files that are found
with gofmt -l with aforementioned directories filtered out:
$ gofmt -l . 2>/dev/null | \
grep -v '^test/' | \
grep -v '/testdata/' | \
grep -v '/vendor/' | wc -l
51
None of the 51 files are generated. After this change, the same command
prints 0.
For #41184.
Change-Id: Ia96ee2a0f998d6a167d4473bcad17ad09bc1d86e
Reviewed-on: https://go-review.googlesource.com/c/go/+/341009
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/noder')
-rw-r--r-- | src/cmd/compile/internal/noder/frames_go1.go | 1 | ||||
-rw-r--r-- | src/cmd/compile/internal/noder/frames_go17.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/noder/frames_go1.go b/src/cmd/compile/internal/noder/frames_go1.go index 2958efd622..d00e0f51f9 100644 --- a/src/cmd/compile/internal/noder/frames_go1.go +++ b/src/cmd/compile/internal/noder/frames_go1.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !go1.7 // +build !go1.7 // TODO(mdempsky): Remove after #44505 is resolved diff --git a/src/cmd/compile/internal/noder/frames_go17.go b/src/cmd/compile/internal/noder/frames_go17.go index 273217e39a..48d77625b4 100644 --- a/src/cmd/compile/internal/noder/frames_go17.go +++ b/src/cmd/compile/internal/noder/frames_go17.go @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build go1.7 // +build go1.7 package noder |