MCPcopy Index your code
hub / github.com/dnote/dnote / ReadStdInput

Function ReadStdInput

pkg/cli/ui/terminal.go:88–101  ·  view source on GitHub ↗

Grab text from stdin content

()

Source from the content-addressed store, hash-verified

86
87// Grab text from stdin content
88func ReadStdInput() (string, error) {
89 var lines []string
90
91 s := bufio.NewScanner(os.Stdin)
92 for s.Scan() {
93 lines = append(lines, s.Text())
94 }
95 err := s.Err()
96 if err != nil {
97 return "", errors.Wrap(err, "reading pipe")
98 }
99
100 return strings.Join(lines, "\n"), nil
101}

Callers 1

getContentFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected