Source File
read.go
Belonging Package
github.com/go-git/go-git/v5/utils/binary
package binary
import (
)
func ( io.Reader) (int64, error) {
var byte
if := Read(, &); != nil {
return 0,
}
var = int64( & maskLength)
for &maskContinue > 0 {
++
if := Read(, &); != nil {
return 0,
}
= ( << lengthBits) + int64(&maskLength)
}
return , nil
}
const (
maskContinue = uint8(128) // 1000 000
maskLength = uint8(127) // 0111 1111
lengthBits = uint8(7) // subsequent bytes has 7 bits to store the length
)
![]() |
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. |