Skip to content

Commit 039e37c

Browse files
authored
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.
1 parent 3242228 commit 039e37c

File tree

9 files changed

+9
-1
lines changed

9 files changed

+9
-1
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ jobs:
2626
- name: Test
2727
run: go test -v -race ./...
2828
- name: Format
29-
if: matrix.go-version == '1.16.x'
29+
if: matrix.go-version == '1.17.x'
3030
run: diff -u <(echo -n) <(gofmt -d .)

cmp/cmpopts/errors_go113.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build go1.13
56
// +build go1.13
67

78
package cmpopts

cmp/cmpopts/errors_xerrors.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !go1.13
56
// +build !go1.13
67

78
// TODO(≥go1.13): For support on <go1.13, we use the xerrors package.

cmp/export_panic.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build purego
56
// +build purego
67

78
package cmp

cmp/export_unsafe.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !purego
56
// +build !purego
67

78
package cmp

cmp/internal/diff/debug_disable.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !cmp_debug
56
// +build !cmp_debug
67

78
package diff

cmp/internal/diff/debug_enable.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build cmp_debug
56
// +build cmp_debug
67

78
package diff

cmp/internal/value/pointer_purego.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build purego
56
// +build purego
67

78
package value

cmp/internal/value/pointer_unsafe.go

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Use of this source code is governed by a BSD-style
33
// license that can be found in the LICENSE file.
44

5+
//go:build !purego
56
// +build !purego
67

78
package value

0 commit comments

Comments
 (0)