MCPcopy
hub / github.com/rs/zerolog / processInput

Function processInput

cmd/prettylog/prettylog.go:20–35  ·  view source on GitHub ↗
(reader io.Reader, writer io.Writer)

Source from the content-addressed store, hash-verified

18}
19
20func processInput(reader io.Reader, writer io.Writer) error {
21 scanner := bufio.NewScanner(reader)
22 for scanner.Scan() {
23 bytesToWrite := scanner.Bytes()
24 _, err := writer.Write(bytesToWrite)
25 if err != nil {
26 if errors.Is(err, io.EOF) {
27 break
28 }
29
30 fmt.Printf("%s\n", bytesToWrite)
31 }
32 }
33
34 return scanner.Err()
35}
36
37func main() {
38 timeFormats := map[string]string{

Callers 1

mainFunction · 0.85

Calls 4

PrintfMethod · 0.80
ErrMethod · 0.65
BytesMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected