all: remove +build tags (#377)
Commit 759be3dad9 bumped our Go
requirement to 1.18 which allows us to drop support for old-style
`+build` tags. This change runs `go fix ./...` to remove them, and
updates some remaining code generators that produced `+build` lines.
This commit is contained in:
committed by
GitHub
parent
759be3dad9
commit
34ac353c14
@@ -37,7 +37,6 @@ $ go get -u github.com/mmcloughlin/avo
|
|||||||
|
|
||||||
```go
|
```go
|
||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Code generated by command: avogen -output zinstructions_test.go buildtest. DO NOT EDIT.
|
// Code generated by command: avogen -output zinstructions_test.go buildtest. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build !integration
|
//go:build !integration
|
||||||
// +build !integration
|
|
||||||
|
|
||||||
package build
|
package build
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build !go1.17
|
//go:build !go1.17
|
||||||
// +build !go1.17
|
|
||||||
|
|
||||||
package buildtags
|
package buildtags
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build go1.17 && !go1.18
|
//go:build go1.17 && !go1.18
|
||||||
// +build go1.17,!go1.18
|
|
||||||
|
|
||||||
package buildtags
|
package buildtags
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build go1.18
|
//go:build go1.18
|
||||||
// +build go1.18
|
|
||||||
|
|
||||||
package buildtags
|
package buildtags
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ The [code generator](asm.go) is as follows:
|
|||||||
[embedmd]:# (asm.go)
|
[embedmd]:# (asm.go)
|
||||||
```go
|
```go
|
||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// +build ignore
|
//go:build ignore
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ func NewBuildTest(cfg printer.Config) Interface {
|
|||||||
|
|
||||||
func (b *buildtest) Generate(is []inst.Instruction) ([]byte, error) {
|
func (b *buildtest) Generate(is []inst.Instruction) ([]byte, error) {
|
||||||
b.Printf("// %s\n\n", b.cfg.GeneratedWarning())
|
b.Printf("// %s\n\n", b.cfg.GeneratedWarning())
|
||||||
b.BuildTag("!integration")
|
b.BuildConstraint("!integration")
|
||||||
b.NL()
|
b.NL()
|
||||||
b.Printf("package build\n\n")
|
b.Printf("package build\n\n")
|
||||||
b.Printf("import (\n")
|
b.Printf("import (\n")
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ func NewCtorsTest(cfg printer.Config) Interface {
|
|||||||
|
|
||||||
func (c *ctorstest) Generate(is []inst.Instruction) ([]byte, error) {
|
func (c *ctorstest) Generate(is []inst.Instruction) ([]byte, error) {
|
||||||
c.Printf("// %s\n\n", c.cfg.GeneratedWarning())
|
c.Printf("// %s\n\n", c.cfg.GeneratedWarning())
|
||||||
c.BuildTag("!integration")
|
c.BuildConstraint("!integration")
|
||||||
c.NL()
|
c.NL()
|
||||||
c.Printf("package x86\n\n")
|
c.Printf("package x86\n\n")
|
||||||
c.Printf("import (\n")
|
c.Printf("import (\n")
|
||||||
@@ -65,7 +65,7 @@ func NewCtorsStress(cfg printer.Config) Interface {
|
|||||||
|
|
||||||
func (c *ctorsstress) Generate(is []inst.Instruction) ([]byte, error) {
|
func (c *ctorsstress) Generate(is []inst.Instruction) ([]byte, error) {
|
||||||
c.Printf("// %s\n\n", c.cfg.GeneratedWarning())
|
c.Printf("// %s\n\n", c.cfg.GeneratedWarning())
|
||||||
c.BuildTag("stress")
|
c.BuildConstraint("stress")
|
||||||
c.NL()
|
c.NL()
|
||||||
c.Printf("package x86\n\n")
|
c.Printf("package x86\n\n")
|
||||||
c.Printf("import (\n")
|
c.Printf("import (\n")
|
||||||
@@ -112,7 +112,7 @@ func NewCtorsBench(cfg printer.Config) Interface {
|
|||||||
|
|
||||||
func (c *ctorsbench) Generate(is []inst.Instruction) ([]byte, error) {
|
func (c *ctorsbench) Generate(is []inst.Instruction) ([]byte, error) {
|
||||||
c.Printf("// %s\n\n", c.cfg.GeneratedWarning())
|
c.Printf("// %s\n\n", c.cfg.GeneratedWarning())
|
||||||
c.BuildTag("stress")
|
c.BuildConstraint("stress")
|
||||||
c.NL()
|
c.NL()
|
||||||
c.Printf("package x86\n\n")
|
c.Printf("package x86\n\n")
|
||||||
c.Printf("import (\n")
|
c.Printf("import (\n")
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// stress-test only build.
|
// stress-test only build.
|
||||||
|
|
||||||
//go:build stress
|
//go:build stress
|
||||||
// +build stress
|
|
||||||
|
|
||||||
package inst
|
package inst
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package prnt
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go/build/constraint"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@@ -75,9 +76,13 @@ func (g *Generator) Comment(lines ...string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// BuildTag outputs a build tag.
|
// BuildConstraint outputs a build constraint.
|
||||||
func (g *Generator) BuildTag(tag string) {
|
func (g *Generator) BuildConstraint(expr string) {
|
||||||
g.Comment("+build " + tag)
|
line := fmt.Sprintf("//go:build %s", expr)
|
||||||
|
if _, err := constraint.Parse(line); err != nil {
|
||||||
|
g.AddError(err)
|
||||||
|
}
|
||||||
|
g.Linef(line)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddError records an error in code generation. The first non-nil error will
|
// AddError records an error in code generation. The first non-nil error will
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
1
tests/thirdparty/make_workflow.go
vendored
1
tests/thirdparty/make_workflow.go
vendored
@@ -1,5 +1,4 @@
|
|||||||
//go:build ignore
|
//go:build ignore
|
||||||
// +build ignore
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// are limited to stress-test mode.
|
// are limited to stress-test mode.
|
||||||
|
|
||||||
//go:build stress
|
//go:build stress
|
||||||
// +build stress
|
|
||||||
|
|
||||||
package x86
|
package x86
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
// Code generated by command: avogen -output zctors_test.go ctorstest. DO NOT EDIT.
|
// Code generated by command: avogen -output zctors_test.go ctorstest. DO NOT EDIT.
|
||||||
|
|
||||||
//go:build !integration
|
//go:build !integration
|
||||||
// +build !integration
|
|
||||||
|
|
||||||
package x86
|
package x86
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user