forked from TrueCloudLab/restic
Remove remnant of Go 1.9 compatibility code from tests
This commit is contained in:
parent
616f9499ae
commit
4f6fd9fb98
4 changed files with 9 additions and 25 deletions
|
@ -4,8 +4,6 @@ import (
|
|||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/restic/restic/internal/test"
|
||||
)
|
||||
|
||||
// IsRegularFile returns true if fi belongs to a normal file. If fi is nil,
|
||||
|
@ -20,7 +18,7 @@ func IsRegularFile(fi os.FileInfo) bool {
|
|||
|
||||
// TestChdir changes the current directory to dest, the function back returns to the previous directory.
|
||||
func TestChdir(t testing.TB, dest string) (back func()) {
|
||||
test.Helper(t).Helper()
|
||||
t.Helper()
|
||||
|
||||
prev, err := os.Getwd()
|
||||
if err != nil {
|
||||
|
@ -34,7 +32,7 @@ func TestChdir(t testing.TB, dest string) (back func()) {
|
|||
}
|
||||
|
||||
return func() {
|
||||
test.Helper(t).Helper()
|
||||
t.Helper()
|
||||
t.Logf("chdir back to %v", prev)
|
||||
err = os.Chdir(prev)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue