From a6279dfb504b95d47f7f52627d9555a8e71649f3 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Fri, 5 Jan 2024 01:09:41 +0100 Subject: [PATCH] Remove unnecessary +build tags The go:build tags are sufficient and the +build tags are no longer needed since switching to Go 1.18 in commit 73ea1b38cdbc ("go.mod: update to go 1.18"). --- cgotest/sysconf_cgotest.go | 1 - example_test.go | 1 - mksysconf.go | 7 ++----- sysconf_bsd.go | 1 - sysconf_defs_darwin.go | 1 - sysconf_defs_dragonfly.go | 1 - sysconf_defs_freebsd.go | 1 - sysconf_defs_linux.go | 1 - sysconf_defs_netbsd.go | 1 - sysconf_defs_openbsd.go | 1 - sysconf_defs_solaris.go | 1 - sysconf_generic.go | 1 - sysconf_posix.go | 1 - sysconf_test.go | 1 - sysconf_unsupported.go | 1 - sysconf_values_freebsd.go | 1 - sysconf_values_linux.go | 1 - sysconf_values_netbsd.go | 1 - zsysconf_defs_darwin.go | 1 - zsysconf_defs_dragonfly.go | 1 - zsysconf_defs_freebsd.go | 1 - zsysconf_defs_linux.go | 1 - zsysconf_defs_netbsd.go | 1 - zsysconf_defs_openbsd.go | 1 - zsysconf_defs_solaris.go | 1 - zsysconf_values_freebsd_386.go | 1 - zsysconf_values_freebsd_amd64.go | 1 - zsysconf_values_freebsd_arm.go | 1 - zsysconf_values_freebsd_arm64.go | 1 - zsysconf_values_freebsd_riscv64.go | 1 - zsysconf_values_linux_386.go | 1 - zsysconf_values_linux_amd64.go | 1 - zsysconf_values_linux_arm.go | 1 - zsysconf_values_linux_arm64.go | 1 - zsysconf_values_linux_loong64.go | 1 - zsysconf_values_linux_mips.go | 1 - zsysconf_values_linux_mips64.go | 1 - zsysconf_values_linux_mips64le.go | 1 - zsysconf_values_linux_mipsle.go | 1 - zsysconf_values_linux_ppc64.go | 1 - zsysconf_values_linux_ppc64le.go | 1 - zsysconf_values_linux_riscv64.go | 1 - zsysconf_values_linux_s390x.go | 1 - zsysconf_values_netbsd_386.go | 1 - zsysconf_values_netbsd_amd64.go | 1 - zsysconf_values_netbsd_arm.go | 1 - zsysconf_values_netbsd_arm64.go | 1 - 47 files changed, 2 insertions(+), 51 deletions(-) diff --git a/cgotest/sysconf_cgotest.go b/cgotest/sysconf_cgotest.go index 1a00804..6ee36b7 100644 --- a/cgotest/sysconf_cgotest.go +++ b/cgotest/sysconf_cgotest.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris -// +build darwin dragonfly freebsd linux netbsd openbsd solaris package sysconf_cgotest diff --git a/example_test.go b/example_test.go index 425c601..aabf4f7 100644 --- a/example_test.go +++ b/example_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris -// +build darwin dragonfly freebsd linux netbsd openbsd solaris package sysconf_test diff --git a/mksysconf.go b/mksysconf.go index 6f5ddba..eae4fd8 100644 --- a/mksysconf.go +++ b/mksysconf.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package main @@ -33,16 +32,14 @@ func gensysconf(in, out, goos, goarch string) error { return err } - goBuild, build := goos, goos + goBuild := goos if goarch != "" { goBuild = fmt.Sprintf("%s && %s", goos, goarch) - build = fmt.Sprintf("%s,%s", goos, goarch) } r := fmt.Sprintf(`$1 -//go:build %s -// +build %s`, goBuild, build) +//go:build %s`, goBuild) cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`) b = cgoCommandRegex.ReplaceAll(b, []byte(r)) diff --git a/sysconf_bsd.go b/sysconf_bsd.go index 7c96157..ec81c02 100644 --- a/sysconf_bsd.go +++ b/sysconf_bsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || netbsd || openbsd -// +build darwin dragonfly freebsd netbsd openbsd package sysconf diff --git a/sysconf_defs_darwin.go b/sysconf_defs_darwin.go index 72e6202..b94f676 100644 --- a/sysconf_defs_darwin.go +++ b/sysconf_defs_darwin.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_defs_dragonfly.go b/sysconf_defs_dragonfly.go index d61556f..f7aab70 100644 --- a/sysconf_defs_dragonfly.go +++ b/sysconf_defs_dragonfly.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_defs_freebsd.go b/sysconf_defs_freebsd.go index 9a30393..3cffc5a 100644 --- a/sysconf_defs_freebsd.go +++ b/sysconf_defs_freebsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_defs_linux.go b/sysconf_defs_linux.go index 718ae06..f0b1d1f 100644 --- a/sysconf_defs_linux.go +++ b/sysconf_defs_linux.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_defs_netbsd.go b/sysconf_defs_netbsd.go index 87ab48f..13a95ef 100644 --- a/sysconf_defs_netbsd.go +++ b/sysconf_defs_netbsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_defs_openbsd.go b/sysconf_defs_openbsd.go index e2932bd..dfdb5e3 100644 --- a/sysconf_defs_openbsd.go +++ b/sysconf_defs_openbsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_defs_solaris.go b/sysconf_defs_solaris.go index 16954b0..d4e9d2c 100644 --- a/sysconf_defs_solaris.go +++ b/sysconf_defs_solaris.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_generic.go b/sysconf_generic.go index 248bdc9..7dcc6f4 100644 --- a/sysconf_generic.go +++ b/sysconf_generic.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd -// +build darwin dragonfly freebsd linux netbsd openbsd package sysconf diff --git a/sysconf_posix.go b/sysconf_posix.go index e61c0bc..830d822 100644 --- a/sysconf_posix.go +++ b/sysconf_posix.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || linux || openbsd -// +build darwin dragonfly freebsd linux openbsd package sysconf diff --git a/sysconf_test.go b/sysconf_test.go index 3b2dc5a..6047c6b 100644 --- a/sysconf_test.go +++ b/sysconf_test.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris -// +build darwin dragonfly freebsd linux netbsd openbsd solaris package sysconf_test diff --git a/sysconf_unsupported.go b/sysconf_unsupported.go index 478d692..5aa9119 100644 --- a/sysconf_unsupported.go +++ b/sysconf_unsupported.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris -// +build !darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris package sysconf diff --git a/sysconf_values_freebsd.go b/sysconf_values_freebsd.go index 76e2ee0..e2da55e 100644 --- a/sysconf_values_freebsd.go +++ b/sysconf_values_freebsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_values_linux.go b/sysconf_values_linux.go index 7c09e75..b6e3c9c 100644 --- a/sysconf_values_linux.go +++ b/sysconf_values_linux.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/sysconf_values_netbsd.go b/sysconf_values_netbsd.go index 5b78f67..9278ee2 100644 --- a/sysconf_values_netbsd.go +++ b/sysconf_values_netbsd.go @@ -3,7 +3,6 @@ // license that can be found in the LICENSE file. //go:build ignore -// +build ignore package sysconf diff --git a/zsysconf_defs_darwin.go b/zsysconf_defs_darwin.go index 6fadf3d..9cb1a72 100644 --- a/zsysconf_defs_darwin.go +++ b/zsysconf_defs_darwin.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_defs_darwin.go //go:build darwin -// +build darwin package sysconf diff --git a/zsysconf_defs_dragonfly.go b/zsysconf_defs_dragonfly.go index 0864cd4..dae5657 100644 --- a/zsysconf_defs_dragonfly.go +++ b/zsysconf_defs_dragonfly.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_defs_dragonfly.go //go:build dragonfly -// +build dragonfly package sysconf diff --git a/zsysconf_defs_freebsd.go b/zsysconf_defs_freebsd.go index 9885411..068f8a7 100644 --- a/zsysconf_defs_freebsd.go +++ b/zsysconf_defs_freebsd.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_defs_freebsd.go //go:build freebsd -// +build freebsd package sysconf diff --git a/zsysconf_defs_linux.go b/zsysconf_defs_linux.go index 8545a34..12f289d 100644 --- a/zsysconf_defs_linux.go +++ b/zsysconf_defs_linux.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_defs_linux.go //go:build linux -// +build linux package sysconf diff --git a/zsysconf_defs_netbsd.go b/zsysconf_defs_netbsd.go index d2aaf07..772af47 100644 --- a/zsysconf_defs_netbsd.go +++ b/zsysconf_defs_netbsd.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_defs_netbsd.go //go:build netbsd -// +build netbsd package sysconf diff --git a/zsysconf_defs_openbsd.go b/zsysconf_defs_openbsd.go index badc66c..625b098 100644 --- a/zsysconf_defs_openbsd.go +++ b/zsysconf_defs_openbsd.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_defs_openbsd.go //go:build openbsd -// +build openbsd package sysconf diff --git a/zsysconf_defs_solaris.go b/zsysconf_defs_solaris.go index 29b6f87..c155cf5 100644 --- a/zsysconf_defs_solaris.go +++ b/zsysconf_defs_solaris.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_defs_solaris.go //go:build solaris -// +build solaris package sysconf diff --git a/zsysconf_values_freebsd_386.go b/zsysconf_values_freebsd_386.go index 478fe63..b5d4807 100644 --- a/zsysconf_values_freebsd_386.go +++ b/zsysconf_values_freebsd_386.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_freebsd.go //go:build freebsd && 386 -// +build freebsd,386 package sysconf diff --git a/zsysconf_values_freebsd_amd64.go b/zsysconf_values_freebsd_amd64.go index 7f58a4d..89c880a 100644 --- a/zsysconf_values_freebsd_amd64.go +++ b/zsysconf_values_freebsd_amd64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_freebsd.go //go:build freebsd && amd64 -// +build freebsd,amd64 package sysconf diff --git a/zsysconf_values_freebsd_arm.go b/zsysconf_values_freebsd_arm.go index deb4759..7b65fdd 100644 --- a/zsysconf_values_freebsd_arm.go +++ b/zsysconf_values_freebsd_arm.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_freebsd.go //go:build freebsd && arm -// +build freebsd,arm package sysconf diff --git a/zsysconf_values_freebsd_arm64.go b/zsysconf_values_freebsd_arm64.go index 556ba3d..a86cb32 100644 --- a/zsysconf_values_freebsd_arm64.go +++ b/zsysconf_values_freebsd_arm64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_freebsd.go //go:build freebsd && arm64 -// +build freebsd,arm64 package sysconf diff --git a/zsysconf_values_freebsd_riscv64.go b/zsysconf_values_freebsd_riscv64.go index b7cff76..6c847ae 100644 --- a/zsysconf_values_freebsd_riscv64.go +++ b/zsysconf_values_freebsd_riscv64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_freebsd.go //go:build freebsd && riscv64 -// +build freebsd,riscv64 package sysconf diff --git a/zsysconf_values_linux_386.go b/zsysconf_values_linux_386.go index 16ee7ea..90963eb 100644 --- a/zsysconf_values_linux_386.go +++ b/zsysconf_values_linux_386.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && 386 -// +build linux,386 package sysconf diff --git a/zsysconf_values_linux_amd64.go b/zsysconf_values_linux_amd64.go index 39aee34..28ad6f1 100644 --- a/zsysconf_values_linux_amd64.go +++ b/zsysconf_values_linux_amd64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && amd64 -// +build linux,amd64 package sysconf diff --git a/zsysconf_values_linux_arm.go b/zsysconf_values_linux_arm.go index 2e40116..ffbcf37 100644 --- a/zsysconf_values_linux_arm.go +++ b/zsysconf_values_linux_arm.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && arm -// +build linux,arm package sysconf diff --git a/zsysconf_values_linux_arm64.go b/zsysconf_values_linux_arm64.go index 362403a..cc9f4d8 100644 --- a/zsysconf_values_linux_arm64.go +++ b/zsysconf_values_linux_arm64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && arm64 -// +build linux,arm64 package sysconf diff --git a/zsysconf_values_linux_loong64.go b/zsysconf_values_linux_loong64.go index 95a71f4..f62b15a 100644 --- a/zsysconf_values_linux_loong64.go +++ b/zsysconf_values_linux_loong64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && loong64 -// +build linux,loong64 package sysconf diff --git a/zsysconf_values_linux_mips.go b/zsysconf_values_linux_mips.go index 868b0ff..37f492a 100644 --- a/zsysconf_values_linux_mips.go +++ b/zsysconf_values_linux_mips.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && mips -// +build linux,mips package sysconf diff --git a/zsysconf_values_linux_mips64.go b/zsysconf_values_linux_mips64.go index 5949f3d..ae7b7f9 100644 --- a/zsysconf_values_linux_mips64.go +++ b/zsysconf_values_linux_mips64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && mips64 -// +build linux,mips64 package sysconf diff --git a/zsysconf_values_linux_mips64le.go b/zsysconf_values_linux_mips64le.go index 1853419..fe14670 100644 --- a/zsysconf_values_linux_mips64le.go +++ b/zsysconf_values_linux_mips64le.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && mips64le -// +build linux,mips64le package sysconf diff --git a/zsysconf_values_linux_mipsle.go b/zsysconf_values_linux_mipsle.go index ff41b34..d204585 100644 --- a/zsysconf_values_linux_mipsle.go +++ b/zsysconf_values_linux_mipsle.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && mipsle -// +build linux,mipsle package sysconf diff --git a/zsysconf_values_linux_ppc64.go b/zsysconf_values_linux_ppc64.go index 3887437..9ec78d3 100644 --- a/zsysconf_values_linux_ppc64.go +++ b/zsysconf_values_linux_ppc64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && ppc64 -// +build linux,ppc64 package sysconf diff --git a/zsysconf_values_linux_ppc64le.go b/zsysconf_values_linux_ppc64le.go index 6d76929..a542067 100644 --- a/zsysconf_values_linux_ppc64le.go +++ b/zsysconf_values_linux_ppc64le.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && ppc64le -// +build linux,ppc64le package sysconf diff --git a/zsysconf_values_linux_riscv64.go b/zsysconf_values_linux_riscv64.go index 3d7d71b..bfb9239 100644 --- a/zsysconf_values_linux_riscv64.go +++ b/zsysconf_values_linux_riscv64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && riscv64 -// +build linux,riscv64 package sysconf diff --git a/zsysconf_values_linux_s390x.go b/zsysconf_values_linux_s390x.go index 9cf8529..6e935c8 100644 --- a/zsysconf_values_linux_s390x.go +++ b/zsysconf_values_linux_s390x.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_linux.go //go:build linux && s390x -// +build linux,s390x package sysconf diff --git a/zsysconf_values_netbsd_386.go b/zsysconf_values_netbsd_386.go index 3cd64dd..ea0b24a 100644 --- a/zsysconf_values_netbsd_386.go +++ b/zsysconf_values_netbsd_386.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_netbsd.go //go:build netbsd && 386 -// +build netbsd,386 package sysconf diff --git a/zsysconf_values_netbsd_amd64.go b/zsysconf_values_netbsd_amd64.go index 02fc1d0..2d377e2 100644 --- a/zsysconf_values_netbsd_amd64.go +++ b/zsysconf_values_netbsd_amd64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_netbsd.go //go:build netbsd && amd64 -// +build netbsd,amd64 package sysconf diff --git a/zsysconf_values_netbsd_arm.go b/zsysconf_values_netbsd_arm.go index 16f9b6e..4a6d836 100644 --- a/zsysconf_values_netbsd_arm.go +++ b/zsysconf_values_netbsd_arm.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_netbsd.go //go:build netbsd && arm -// +build netbsd,arm package sysconf diff --git a/zsysconf_values_netbsd_arm64.go b/zsysconf_values_netbsd_arm64.go index e530339..49fb672 100644 --- a/zsysconf_values_netbsd_arm64.go +++ b/zsysconf_values_netbsd_arm64.go @@ -2,7 +2,6 @@ // cgo -godefs sysconf_values_netbsd.go //go:build netbsd && arm64 -// +build netbsd,arm64 package sysconf