all: update go directive to 1.18

Done with:

go get go@1.18
go mod tidy
go fix ./...

Using go1.21.3.

Also update code generators to use only the new go:build lines,
not the old +build ones.

For golang/go#60268.

Change-Id: I6aabc42efb6ab3329981100e1db2263aac5e92a6
Reviewed-on: https://go-review.googlesource.com/c/sys/+/534222
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
Dmitri Shuralyov
2023-10-11 21:54:30 +00:00
committed by Gopher Robot
parent 1d9f0b6d88
commit 1bfbee0e20
418 changed files with 24 additions and 534 deletions
+1 -8
View File
@@ -11,7 +11,6 @@
// go run linux/mkall.go <linux_dir> <glibc_dir>
//go:build ignore
// +build ignore
package main
@@ -629,11 +628,7 @@ func (t *target) matchesMksyscallFile(file string) (bool, error) {
s := bufio.NewScanner(f)
for s.Scan() {
// Keep scanning until a valid constraint is found or we hit EOF.
//
// This only supports single-line constraints such as the //go:build
// convention used in Go 1.17+. Because the old //+build convention
// (which may have multiple lines of build tags) is being deprecated,
// we don't bother looking for multi-line constraints.
// This is sufficient for the single-line //go:build constraints.
if expr, err = constraint.Parse(s.Text()); err == nil {
found = true
break
@@ -752,8 +747,6 @@ func generatePtracePair(arch1, arch2, archName string) error {
fmt.Fprintf(buf, "// Code generated by linux/mkall.go generatePtracePair(%q, %q). DO NOT EDIT.\n", arch1, arch2)
fmt.Fprintf(buf, "\n")
fmt.Fprintf(buf, "//go:build linux && (%s || %s)\n", arch1, arch2)
fmt.Fprintf(buf, "// +build linux\n")
fmt.Fprintf(buf, "// +build %s %s\n", arch1, arch2)
fmt.Fprintf(buf, "\n")
fmt.Fprintf(buf, "package unix\n")
fmt.Fprintf(buf, "\n")
+1 -8
View File
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ignore
// +build ignore
package main
@@ -32,11 +31,6 @@ func goBuildTags() string {
return fmt.Sprintf("%s && %s", goarch, goos)
}
// plusBuildTags returns build tags in the +build format.
func plusBuildTags() string {
return fmt.Sprintf("%s,%s", goarch, goos)
}
func format(name string, num int, offset int) (int, string) {
if num > 999 {
// ignore deprecated syscalls that are no longer implemented
@@ -186,14 +180,13 @@ func main() {
for _, num := range nums {
text.WriteString(num.declaration)
}
fmt.Printf(template, cmdLine(), goBuildTags(), plusBuildTags(), text.String())
fmt.Printf(template, cmdLine(), goBuildTags(), text.String())
}
const template = `// %s
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build %s
// +build %s
package unix
-1
View File
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ignore
// +build ignore
/*
Input to cgo -godefs. See README.md