aboutsummaryrefslogtreecommitdiff
path: root/src/os/readfrom_linux_test.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2023-03-28 14:35:20 -0700
committerGopher Robot <gobot@golang.org>2023-03-29 16:21:13 +0000
commitb441eb3f978b8b7d4f09f8e583d419d8f4e40af6 (patch)
treecaf2e5acb32ffb4f158c571c6e68ffb852778f94 /src/os/readfrom_linux_test.go
parentf57f02fcd519a86683c47a444e0e24a086fea8e0 (diff)
downloadgo-b441eb3f978b8b7d4f09f8e583d419d8f4e40af6.tar.xz
os: remove mixed dot- and non-dot- imports in tests
Some test files imported "os" twice, once with a dot and once without. Consolidate on importing with a dot. Change-Id: I1db31053dff9dee19a6bdfc263c7e7ef0c15ee42 Reviewed-on: https://go-review.googlesource.com/c/go/+/479995 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/os/readfrom_linux_test.go')
-rw-r--r--src/os/readfrom_linux_test.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/os/readfrom_linux_test.go b/src/os/readfrom_linux_test.go
index 70dccab8d1..4f98be4b9b 100644
--- a/src/os/readfrom_linux_test.go
+++ b/src/os/readfrom_linux_test.go
@@ -12,7 +12,6 @@ import (
"io"
"math/rand"
"net"
- "os"
. "os"
"path/filepath"
"runtime"
@@ -85,13 +84,13 @@ func TestCopyFileRange(t *testing.T) {
t.Run("CopyFileItself", func(t *testing.T) {
hook := hookCopyFileRange(t)
- f, err := os.CreateTemp("", "file-readfrom-itself-test")
+ f, err := CreateTemp("", "file-readfrom-itself-test")
if err != nil {
t.Fatalf("failed to create tmp file: %v", err)
}
t.Cleanup(func() {
f.Close()
- os.Remove(f.Name())
+ Remove(f.Name())
})
data := []byte("hello world!")
@@ -231,7 +230,7 @@ func TestCopyFileRange(t *testing.T) {
})
t.Run("Nil", func(t *testing.T) {
var nilFile *File
- anyFile, err := os.CreateTemp("", "")
+ anyFile, err := CreateTemp("", "")
if err != nil {
t.Fatal(err)
}
@@ -721,17 +720,17 @@ func TestProcCopy(t *testing.T) {
t.Parallel()
const cmdlineFile = "/proc/self/cmdline"
- cmdline, err := os.ReadFile(cmdlineFile)
+ cmdline, err := ReadFile(cmdlineFile)
if err != nil {
t.Skipf("can't read /proc file: %v", err)
}
- in, err := os.Open(cmdlineFile)
+ in, err := Open(cmdlineFile)
if err != nil {
t.Fatal(err)
}
defer in.Close()
outFile := filepath.Join(t.TempDir(), "cmdline")
- out, err := os.Create(outFile)
+ out, err := Create(outFile)
if err != nil {
t.Fatal(err)
}
@@ -741,7 +740,7 @@ func TestProcCopy(t *testing.T) {
if err := out.Close(); err != nil {
t.Fatal(err)
}
- copy, err := os.ReadFile(outFile)
+ copy, err := ReadFile(outFile)
if err != nil {
t.Fatal(err)
}
@@ -766,7 +765,7 @@ func testGetPollFromReader(t *testing.T, proto string) {
t.Fatalf("server SyscallConn error: %v", err)
}
if err = rc.Control(func(fd uintptr) {
- pfd := os.GetPollFDForTest(server)
+ pfd := GetPollFDForTest(server)
if pfd == nil {
t.Fatalf("GetPollFDForTest didn't return poll.FD")
}