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
+3 -12
View File
@@ -3,7 +3,6 @@
// license that can be found in the LICENSE file.
//go:build ignore
// +build ignore
/*
This program reads a file containing function prototypes
@@ -88,11 +87,6 @@ func goBuildTags() string {
return strings.ReplaceAll(*tags, ",", " && ")
}
// plusBuildTags returns build tags in the +build format.
func plusBuildTags() string {
return *tags
}
// Param is function parameter
type Param struct {
Name string
@@ -525,7 +519,7 @@ func main() {
// Print zsyscall_aix_ppc64.go
err := os.WriteFile("zsyscall_aix_ppc64.go",
[]byte(fmt.Sprintf(srcTemplate1, cmdLine(), goBuildTags(), plusBuildTags(), pack, imp, textcommon)),
[]byte(fmt.Sprintf(srcTemplate1, cmdLine(), goBuildTags(), pack, imp, textcommon)),
0644)
if err != nil {
fmt.Fprintf(os.Stderr, err.Error())
@@ -536,7 +530,7 @@ func main() {
vardecls := "\t" + strings.Join(vars, ",\n\t")
vardecls += " syscallFunc"
err = os.WriteFile("zsyscall_aix_ppc64_gc.go",
[]byte(fmt.Sprintf(srcTemplate2, cmdLine(), goBuildTags(), plusBuildTags(), pack, imp, dynimports, linknames, vardecls, textgc)),
[]byte(fmt.Sprintf(srcTemplate2, cmdLine(), goBuildTags(), pack, imp, dynimports, linknames, vardecls, textgc)),
0644)
if err != nil {
fmt.Fprintf(os.Stderr, err.Error())
@@ -545,7 +539,7 @@ func main() {
// Print zsyscall_aix_ppc64_gccgo.go
err = os.WriteFile("zsyscall_aix_ppc64_gccgo.go",
[]byte(fmt.Sprintf(srcTemplate3, cmdLine(), goBuildTags(), plusBuildTags(), pack, cExtern, imp, textgccgo)),
[]byte(fmt.Sprintf(srcTemplate3, cmdLine(), goBuildTags(), pack, cExtern, imp, textgccgo)),
0644)
if err != nil {
fmt.Fprintf(os.Stderr, err.Error())
@@ -557,7 +551,6 @@ const srcTemplate1 = `// %s
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build %s
// +build %s
package %s
@@ -574,7 +567,6 @@ const srcTemplate2 = `// %s
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build %s && gc
// +build %s,gc
package %s
@@ -600,7 +592,6 @@ const srcTemplate3 = `// %s
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build %s && gccgo
// +build %s,gccgo
package %s