mirror of
https://blitiri.com.ar/repos/chasquid
synced 2026-10-29 15:02:30 +00:00
Apply more mechanical simplifications using recent Go features
This is a follow-up on the `go fix` run in commit
0210c5fd92.
That commit recorded the automated updates.
This one applies further simplifications that are mechanical and do not
involve logic changes, but are outside of what `go fix` did.
It also removes some now-obsolete comments and statements.
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package testlib
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io/fs"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -22,7 +24,7 @@ func TestBasic(t *testing.T) {
|
||||
}
|
||||
|
||||
RemoveIfOk(t, dir)
|
||||
if _, err := os.Stat(dir); !os.IsNotExist(err) {
|
||||
if _, err := os.Stat(dir); !errors.Is(err, fs.ErrNotExist) {
|
||||
t.Fatalf("%s existed, should have been deleted: %v", dir, err)
|
||||
}
|
||||
}
|
||||
@@ -45,7 +47,7 @@ func TestLeaveDirOnError(t *testing.T) {
|
||||
myt.Errorf("something bad happened")
|
||||
|
||||
RemoveIfOk(myt, dir)
|
||||
if _, err := os.Stat(dir); os.IsNotExist(err) {
|
||||
if _, err := os.Stat(dir); errors.Is(err, fs.ErrNotExist) {
|
||||
t.Fatalf("%s was removed, should have been kept", dir)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user