MCPcopy Create free account
hub / github.com/gokcehan/lf / newScanner

Function newScanner

scan.go:39–60  ·  view source on GitHub ↗
(r io.Reader)

Source from the content-addressed store, hash-verified

37}
38
39func newScanner(r io.Reader) *scanner {
40 buf, err := io.ReadAll(r)
41 if err != nil {
42 log.Printf("scanning: %s", err)
43 }
44
45 var eof bool
46 var chr byte
47
48 if len(buf) == 0 {
49 eof = true
50 } else {
51 eof = false
52 chr = buf[0]
53 }
54
55 return &scanner{
56 buf: buf,
57 eof: eof,
58 chr: chr,
59 }
60}
61
62func (s *scanner) next() {
63 if s.off+1 < len(s.buf) {

Callers 2

TestScanFunction · 0.85
newParserFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestScanFunction · 0.68