MCPcopy Index your code
hub / github.com/netdata/netdata / ReadLine

Method ReadLine

src/go/plugin/go.d/pkg/logs/json.go:34–43  ·  view source on GitHub ↗
(line LogLine)

Source from the content-addressed store, hash-verified

32}
33
34func (p *JSONParser) ReadLine(line LogLine) error {
35 row, err := p.reader.ReadSlice('\n')
36 if err != nil && len(row) == 0 {
37 return err
38 }
39 if len(row) > 0 && row[len(row)-1] == '\n' {
40 row = row[:len(row)-1]
41 }
42 return p.Parse(row, line)
43}
44
45func (p *JSONParser) Parse(row []byte, line LogLine) error {
46 val, err := p.parser.ParseBytes(row)

Callers 1

TestJSONParser_ReadLineFunction · 0.95

Calls 1

ParseMethod · 0.95

Tested by 1

TestJSONParser_ReadLineFunction · 0.76