all: use SeekStart, SeekCurrent, SeekEnd

CL/19862 (f79b50b8d5) recently introduced the constants
SeekStart, SeekCurrent, and SeekEnd to the io package. We should use these constants
consistently throughout the code base.

Updates #15269

Change-Id: If7fcaca7676e4a51f588528f5ced28220d9639a2
Reviewed-on: https://go-review.googlesource.com/22097
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Joe Tsai 2016-04-05 11:22:53 -07:00 committed by Brad Fitzpatrick
parent 6db98a3c51
commit acc757f678
27 changed files with 72 additions and 64 deletions

View file

@ -10,6 +10,7 @@ import (
"flag"
"fmt"
"internal/testenv"
"io"
"io/ioutil"
"net"
"os"
@ -244,7 +245,7 @@ func passFDChild() {
}
f.Write([]byte("Hello from child process!\n"))
f.Seek(0, 0)
f.Seek(0, io.SeekStart)
rights := syscall.UnixRights(int(f.Fd()))
dummyByte := []byte("x")
@ -344,7 +345,7 @@ func TestRlimit(t *testing.T) {
}
func TestSeekFailure(t *testing.T) {
_, err := syscall.Seek(-1, 0, 0)
_, err := syscall.Seek(-1, 0, io.SeekStart)
if err == nil {
t.Fatalf("Seek(-1, 0, 0) did not fail")
}