aboutsummaryrefslogtreecommitdiff
path: root/src/syscall
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2021-08-09 20:29:14 -0400
committerDmitri Shuralyov <dmitshur@golang.org>2021-08-13 20:45:17 +0000
commit98f3d7fecbb8a9074f5f4ffc50bb016e194940b7 (patch)
tree8df9912af4753b4127056f5acdf7730bd3fa16ce /src/syscall
parent20a620fd9f7bc35739c1af3602d53808d0430814 (diff)
downloadgo-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/syscall')
-rw-r--r--src/syscall/js/export_test.go1
-rw-r--r--src/syscall/js/func.go1
-rw-r--r--src/syscall/js/js.go1
-rw-r--r--src/syscall/js/js_test.go1
4 files changed, 4 insertions, 0 deletions
diff --git a/src/syscall/js/export_test.go b/src/syscall/js/export_test.go
index 1b5ed3ce84..4bd9c5d595 100644
--- a/src/syscall/js/export_test.go
+++ b/src/syscall/js/export_test.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 js && wasm
// +build js,wasm
package js
diff --git a/src/syscall/js/func.go b/src/syscall/js/func.go
index da4cf68774..ab23e5fbfc 100644
--- a/src/syscall/js/func.go
+++ b/src/syscall/js/func.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 js && wasm
// +build js,wasm
package js
diff --git a/src/syscall/js/js.go b/src/syscall/js/js.go
index a48bbd4dd7..d805d69166 100644
--- a/src/syscall/js/js.go
+++ b/src/syscall/js/js.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 js && wasm
// +build js,wasm
// Package js gives access to the WebAssembly host environment when using the js/wasm architecture.
diff --git a/src/syscall/js/js_test.go b/src/syscall/js/js_test.go
index 5fc9107d40..8088a897f6 100644
--- a/src/syscall/js/js_test.go
+++ b/src/syscall/js/js_test.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 js && wasm
// +build js,wasm
// To run these tests: