Source File
reader.go
Belonging Package
github.com/go-git/go-git/v5/plumbing/format/objfile
func ( *Reader) () ( plumbing.ObjectType, int64, error) {
var []byte
, = .readUntil(' ')
if != nil {
return
}
, = plumbing.ParseObjectType(string())
if != nil {
return
}
, = .readUntil(0)
if != nil {
return
}
, = strconv.ParseInt(string(), 10, 64)
if != nil {
= ErrHeader
return
}
defer .prepareForRead(, )
return
}
func ( *Reader) ( byte) ([]byte, error) {
var [1]byte
:= make([]byte, 0, 16)
for {
if , := .zlib.Read([:]); != nil && ( != io.EOF || == 0) {
if == io.EOF {
return nil, ErrHeader
}
return nil,
}
if [0] == {
return , nil
}
= append(, [0])
}
}
func ( *Reader) ( plumbing.ObjectType, int64) {
.hasher = plumbing.NewHasher(, )
.multi = io.TeeReader(.zlib, .hasher)
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |