mirror of
https://github.com/golang/go
synced 2024-11-23 18:10:04 -07: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) {
|
func (d *sliceWriteSeeker) Seek(offset int64, whence int) (int64, error) {
|
||||||
if whence == os.SEEK_SET {
|
if whence == io.SeekStart {
|
||||||
d.off = offset
|
d.off = offset
|
||||||
return offset, nil
|
return offset, nil
|
||||||
} else if whence == os.SEEK_CUR {
|
} else if whence == io.SeekCurrent {
|
||||||
d.off += offset
|
d.off += offset
|
||||||
return d.off, nil
|
return d.off, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user