From da08b89e252b0f9a1e0ee3b390ab36922cd97485 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 4 Jan 2022 09:41:33 +0100 Subject: [PATCH] Add //go:build lines 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. --- .github/workflows/test.yml | 2 +- cmp/cmpopts/errors_go113.go | 1 + cmp/cmpopts/errors_xerrors.go | 1 + cmp/export_panic.go | 1 + cmp/export_unsafe.go | 1 + cmp/internal/diff/debug_disable.go | 1 + cmp/internal/diff/debug_enable.go | 1 + cmp/internal/value/pointer_purego.go | 1 + cmp/internal/value/pointer_unsafe.go | 1 + 9 files changed, 9 insertions(+), 1 deletion(-) 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