aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2022-01-04 18:50:40 +0100
committerGitHub <noreply@github.com>2022-01-04 09:50:40 -0800
commit039e37cba1f3e52c48404633d6960421b369a19a (patch)
tree6ed017b3d1ab8190bf3ea035f9399b6552604c5f
parent3242228551a7556abc624443ef03a6dbfeeacd22 (diff)
downloadgo-cmp-039e37cba1f3e52c48404633d6960421b369a19a.tar.gz
Add //go:build lines (#285)
Starting with Go 1.17, //go:build lines are preferred over // +build lines, see https://golang.org/doc/go1.17#build-lines and https://golang.org/design/draft-gobuild for details. This change was generated by running Go 1.17 go fmt ./... which automatically adds //go:build lines based on the existing // +build lines. Also update the corresponding GitHub action to use Go 1.17 gofmt.
-rw-r--r--.github/workflows/test.yml2
-rw-r--r--cmp/cmpopts/errors_go113.go1
-rw-r--r--cmp/cmpopts/errors_xerrors.go1
-rw-r--r--cmp/export_panic.go1
-rw-r--r--cmp/export_unsafe.go1
-rw-r--r--cmp/internal/diff/debug_disable.go1
-rw-r--r--cmp/internal/diff/debug_enable.go1
-rw-r--r--cmp/internal/value/pointer_purego.go1
-rw-r--r--cmp/internal/value/pointer_unsafe.go1
9 files changed, 9 insertions, 1 deletions
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 2e6a1c9..5664da6 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -26,5 +26,5 @@ jobs:
- name: Test
run: go test -v -race ./...
- name: Format
- if: matrix.go-version == '1.16.x'
+ if: matrix.go-version == '1.17.x'
run: diff -u <(echo -n) <(gofmt -d .)
diff --git a/cmp/cmpopts/errors_go113.go b/cmp/cmpopts/errors_go113.go
index 26fe25d..8eb2b84 100644
--- a/cmp/cmpopts/errors_go113.go
+++ b/cmp/cmpopts/errors_go113.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.13
// +build go1.13
package cmpopts
diff --git a/cmp/cmpopts/errors_xerrors.go b/cmp/cmpopts/errors_xerrors.go
index 6eeb8d6..60b0727 100644
--- a/cmp/cmpopts/errors_xerrors.go
+++ b/cmp/cmpopts/errors_xerrors.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.13
// +build !go1.13
// TODO(≥go1.13): For support on <go1.13, we use the xerrors package.
diff --git a/cmp/export_panic.go b/cmp/export_panic.go
index 5ff0b42..ae851fe 100644
--- a/cmp/export_panic.go
+++ b/cmp/export_panic.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 purego
// +build purego
package cmp
diff --git a/cmp/export_unsafe.go b/cmp/export_unsafe.go
index 21eb548..e2c0f74 100644
--- a/cmp/export_unsafe.go
+++ b/cmp/export_unsafe.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 !purego
// +build !purego
package cmp
diff --git a/cmp/internal/diff/debug_disable.go b/cmp/internal/diff/debug_disable.go
index 1daaaac..36062a6 100644
--- a/cmp/internal/diff/debug_disable.go
+++ b/cmp/internal/diff/debug_disable.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 !cmp_debug
// +build !cmp_debug
package diff
diff --git a/cmp/internal/diff/debug_enable.go b/cmp/internal/diff/debug_enable.go
index 4b91dbc..a3b97a1 100644
--- a/cmp/internal/diff/debug_enable.go
+++ b/cmp/internal/diff/debug_enable.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 cmp_debug
// +build cmp_debug
package diff
diff --git a/cmp/internal/value/pointer_purego.go b/cmp/internal/value/pointer_purego.go
index 44f4a5a..1a71bfc 100644
--- a/cmp/internal/value/pointer_purego.go
+++ b/cmp/internal/value/pointer_purego.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 purego
// +build purego
package value
diff --git a/cmp/internal/value/pointer_unsafe.go b/cmp/internal/value/pointer_unsafe.go
index a605953..16e6860 100644
--- a/cmp/internal/value/pointer_unsafe.go
+++ b/cmp/internal/value/pointer_unsafe.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 !purego
// +build !purego
package value