mirror of
https://github.com/golang/go
synced 2024-09-05 16:04:50 +00:00
cmd/cover: use io.SeekStart, io.SeekCurrent
Change-Id: Ie3b593f7f0c71334dc8c446d545bf441f2ae81f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/436695 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
0582b7958e
commit
679640aee8
|
@ -1026,10 +1026,10 @@ func (d *sliceWriteSeeker) Write(p []byte) (n int, err error) {
|
|||
}
|
||||
|
||||
func (d *sliceWriteSeeker) Seek(offset int64, whence int) (int64, error) {
|
||||
if whence == os.SEEK_SET {
|
||||
if whence == io.SeekStart {
|
||||
d.off = offset
|
||||
return offset, nil
|
||||
} else if whence == os.SEEK_CUR {
|
||||
} else if whence == io.SeekCurrent {
|
||||
d.off += offset
|
||||
return d.off, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue