MCPcopy Create free account
hub / github.com/antonmedv/gitmal / isLen

Function isLen

pkg/gitdiff/io.go:141–153  ·  view source on GitHub ↗
(r io.ReaderAt, n int64)

Source from the content-addressed store, hash-verified

139}
140
141func isLen(r io.ReaderAt, n int64) (bool, error) {
142 off := n - 1
143 if off < 0 {
144 off = 0
145 }
146
147 var b [2]byte
148 nr, err := r.ReadAt(b[:], off)
149 if err == io.EOF {
150 return (n == 0 && nr == 0) || (n > 0 && nr == 1), nil
151 }
152 return false, err
153}
154
155// copyFrom writes bytes starting from offset off in src to dst stopping at the
156// end of src or at the first error. copyFrom returns the number of bytes

Callers 2

ApplyFragmentMethod · 0.85
checkBinarySrcSizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected