mirror of
https://github.com/golang/go
synced 2024-11-23 23:40:13 -07:00
cmd/internal/goobj: minor dead code cleanup
Remove a bit of dead code from the Go object file reader (io.ReaderAt no longer needed in goobj.Reader). Change-Id: I04150d37fb90b59c9dbe930878d4dd21cdcd7ca7 Reviewed-on: https://go-review.googlesource.com/c/go/+/357309 Trust: Than McIntosh <thanm@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
d2ec73c1bf
commit
27a1454ee0
@ -19,14 +19,12 @@
|
||||
package goobj
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"cmd/internal/bio"
|
||||
"crypto/sha1"
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"internal/unsafeheader"
|
||||
"io"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@ -594,13 +592,12 @@ type Reader struct {
|
||||
b []byte // mmapped bytes, if not nil
|
||||
readonly bool // whether b is backed with read-only memory
|
||||
|
||||
rd io.ReaderAt
|
||||
start uint32
|
||||
h Header // keep block offsets
|
||||
}
|
||||
|
||||
func NewReaderFromBytes(b []byte, readonly bool) *Reader {
|
||||
r := &Reader{b: b, readonly: readonly, rd: bytes.NewReader(b), start: 0}
|
||||
r := &Reader{b: b, readonly: readonly, start: 0}
|
||||
err := r.h.Read(r)
|
||||
if err != nil {
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user