~rogpeppe/+junk/mgo-tagged-log-messages

« back to all changes in this revision

Viewing changes to gridfs.go

  • Committer: Roger Peppe
  • Date: 2014-03-14 18:11:33 UTC
  • mfrom: (263.1.8 master)
  • Revision ID: roger.peppe@canonical.com-20140314181133-107ag3xpitk9682u
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
361
361
        case gfsClosed:
362
362
                panic("GridFile is closed")
363
363
        default:
364
 
                panic("Internal error: missing GridFile mode")
 
364
                panic("internal error: missing GridFile mode")
365
365
        }
366
366
}
367
367
 
639
639
        case os.SEEK_END:
640
640
                offset += file.doc.Length
641
641
        default:
642
 
                panic("Unsupported whence value")
 
642
                panic("unsupported whence value")
643
643
        }
644
644
        if offset > file.doc.Length {
645
 
                return file.offset, errors.New("Seek past end of file")
 
645
                return file.offset, errors.New("seek past end of file")
646
646
        }
647
647
        chunk := int(offset / int64(file.doc.ChunkSize))
648
648
        if chunk+1 == file.chunk && offset >= file.offset {