all: upgrade golangci-lint and formatters (#240)

This commit is contained in:
Michael McLoughlin
2022-03-27 15:31:26 -07:00
committed by GitHub
parent 553930530f
commit 72b8db9c80
24 changed files with 179 additions and 118 deletions

View File

@@ -32,7 +32,7 @@ func Assembles(t *testing.T, asm []byte) {
defer clean()
asmfilename := filepath.Join(dir, "asm.s")
if err := ioutil.WriteFile(asmfilename, asm, 0600); err != nil {
if err := ioutil.WriteFile(asmfilename, asm, 0o600); err != nil {
t.Fatal(err)
}
@@ -96,11 +96,13 @@ func GoTool() string {
// goexec runs a "go" command and checks the output.
func goexec(t *testing.T, arg ...string) {
t.Helper()
Exec(t, GoTool(), arg...)
}
// Logger builds a logger that writes to the test object.
func Logger(tb testing.TB) *log.Logger {
tb.Helper()
return log.New(Writer(tb), "test", log.LstdFlags)
}
@@ -110,6 +112,7 @@ type writer struct {
// Writer builds a writer that logs all writes to the test object.
func Writer(tb testing.TB) io.Writer {
tb.Helper()
return writer{tb}
}