Skip to content

Commit

Permalink
Add //go:build lines (#285)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tklauser authored Jan 4, 2022
1 parent 3242228 commit 039e37c
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .)
1 change: 1 addition & 0 deletions cmp/cmpopts/errors_go113.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmp/cmpopts/errors_xerrors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions cmp/export_panic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmp/export_unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmp/internal/diff/debug_disable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmp/internal/diff/debug_enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmp/internal/value/pointer_purego.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions cmp/internal/value/pointer_unsafe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 039e37c

Please sign in to comment.