Remove io.Writer from fs.File

It was only used in a single test, which now uses plain *os.File instead.
This commit is contained in:
greatroar 2020-02-17 00:20:38 +01:00
parent 9abef3bf1a
commit 1b20f6beec
4 changed files with 32 additions and 41 deletions

View file

@ -1,10 +1,6 @@
package fs
import (
"io/ioutil"
"os"
"testing"
)
import "os"
// IsRegularFile returns true if fi belongs to a normal file. If fi is nil,
// false is returned.
@ -15,22 +11,3 @@ func IsRegularFile(fi os.FileInfo) bool {
return fi.Mode()&(os.ModeType|os.ModeCharDevice) == 0
}
// TestTempFile returns a new temporary file, which is removed when cleanup()
// is called.
func TestTempFile(t testing.TB, prefix string) (File, func()) {
f, err := ioutil.TempFile("", prefix)
if err != nil {
t.Fatal(err)
}
cleanup := func() {
_ = f.Close()
err = Remove(f.Name())
if err != nil {
t.Fatal(err)
}
}
return f, cleanup
}