mirror of https://github.com/golang/go.git
go/internal/pkgbits: replace os.SEEK_CUR with io.SeekCurrent
Change-Id: I68ee64ecc4e9ec3ec5894b878b64cc5611684dd2 GitHub-Last-Rev: 3092826e516c86367bffc799d0547b8f4667f21d GitHub-Pull-Request: golang/tools#399 Reviewed-on: https://go-review.googlesource.com/c/tools/+/431995 Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Hyang-Ah Hana Kim <hyangah@gmail.com> gopls-CI: kokoro <noreply+kokoro@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
parent
835bfdfb41
commit
00ae48efaf
|
|
@ -9,6 +9,7 @@ import (
|
|||
"fmt"
|
||||
"go/constant"
|
||||
"go/token"
|
||||
"io"
|
||||
"math/big"
|
||||
"os"
|
||||
"runtime"
|
||||
|
|
@ -94,7 +95,7 @@ func NewPkgDecoder(pkgPath, input string) PkgDecoder {
|
|||
pr.elemEnds = make([]uint32, pr.elemEndsEnds[len(pr.elemEndsEnds)-1])
|
||||
assert(binary.Read(r, binary.LittleEndian, pr.elemEnds[:]) == nil)
|
||||
|
||||
pos, err := r.Seek(0, os.SEEK_CUR)
|
||||
pos, err := r.Seek(0, io.SeekCurrent)
|
||||
assert(err == nil)
|
||||
|
||||
pr.elemData = input[pos:]
|
||||
|
|
@ -237,7 +238,7 @@ func (r *Decoder) Sync(mWant SyncMarker) {
|
|||
return
|
||||
}
|
||||
|
||||
pos, _ := r.Data.Seek(0, os.SEEK_CUR) // TODO(mdempsky): io.SeekCurrent after #44505 is resolved
|
||||
pos, _ := r.Data.Seek(0, io.SeekCurrent)
|
||||
mHave := SyncMarker(r.rawUvarint())
|
||||
writerPCs := make([]int, r.rawUvarint())
|
||||
for i := range writerPCs {
|
||||
|
|
|
|||
Loading…
Reference in New Issue