From 6faf286b97ff2e13fbdaf2c6179f8aef36b4498c Mon Sep 17 00:00:00 2001 From: Jeremy Stribling Date: Mon, 15 Oct 2018 10:17:37 -0700 Subject: packfile: add comment on GetSizeByOffset Suggested by mcuadros. Issue: src-d/go-git#982 Signed-off-by: Jeremy Stribling --- plumbing/format/packfile/packfile.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'plumbing') diff --git a/plumbing/format/packfile/packfile.go b/plumbing/format/packfile/packfile.go index dbd5d4b..0d13066 100644 --- a/plumbing/format/packfile/packfile.go +++ b/plumbing/format/packfile/packfile.go @@ -90,6 +90,8 @@ func (p *Packfile) GetByOffset(o int64) (plumbing.EncodedObject, error) { return p.nextObject() } +// GetSizeByOffset retrieves the size of the encoded object from the +// packfile with the given offset. func (p *Packfile) GetSizeByOffset(o int64) (size int64, err error) { if _, err := p.s.SeekFromStart(o); err != nil { if err == io.EOF || isInvalid(err) { -- cgit