Lines Matching refs:err
50 f, err := os.Open(name)
51 if err != nil {
52 return nil, err
54 fi, err := f.Stat()
55 if err != nil {
57 return nil, err
60 if err := r.init(f, fi.Size()); err != nil {
62 return nil, err
72 if err := zr.init(r, size); err != nil {
73 return nil, err
79 end, err := readDirectoryEnd(r, size)
80 if err != nil {
81 return err
90 if _, err = rs.Seek(int64(end.directoryOffset), io.SeekStart); err != nil {
91 return err
101 err = readDirectoryHeader(f, buf)
102 if err == ErrFormat || err == io.ErrUnexpectedEOF {
105 if err != nil {
106 return err
113 return err
146 func (f *File) DataOffset() (offset int64, err error) {
147 bodyOffset, err := f.findBodyOffset()
148 if err != nil {
157 bodyOffset, err := f.findBodyOffset()
158 if err != nil {
159 return nil, err
187 err error // sticky error member
190 func (r *checksumReader) Read(b []byte) (n int, err error) {
191 if r.err != nil {
192 return 0, r.err
194 n, err = r.rc.Read(b)
197 if err == nil {
200 if err == io.EOF {
207 err = io.ErrUnexpectedEOF
209 err = err1
212 err = ErrChecksum
219 err = ErrChecksum
223 r.err = err
233 if _, err := f.zipr.ReadAt(buf[:], f.headerOffset); err != nil {
234 return 0, err
251 if _, err := io.ReadFull(r, buf[:]); err != nil {
252 return err
276 if _, err := io.ReadFull(r, d); err != nil {
277 return err
362 if _, err := io.ReadFull(r, buf[:4]); err != nil {
363 return err
372 if _, err := io.ReadFull(r, buf[off:12]); err != nil {
373 return err
389 func readDirectoryEnd(r io.ReaderAt, size int64) (dir *directoryEnd, err error) {
398 if _, err := r.ReadAt(buf, size-bLen); err != nil && err != io.EOF {
399 return nil, err
430 p, err := findDirectory64End(r, directoryEndOffset)
431 if err == nil && p >= 0 {
432 err = readDirectory64End(r, p, d)
434 if err != nil {
435 return nil, err
454 if _, err := r.ReadAt(buf, locOffset); err != nil {
455 return -1, err
473 func readDirectory64End(r io.ReaderAt, offset int64, d *directoryEnd) (err error) {
475 if _, err := r.ReadAt(buf, offset); err != nil {
476 return err