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:
cuiweixie 2022-09-29 20:32:25 +08:00 committed by Gopher Robot
parent 0582b7958e
commit 679640aee8

View file

@ -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
}