MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / readLine

Function readLine

internal/cli/provider_cmd.go:651–668  ·  view source on GitHub ↗

readLine reads up to a newline from in. Used only on the interactive confirmation path; bounded read so we don't hang on a closed stdin.

(in io.Reader)

Source from the content-addressed store, hash-verified

649// readLine reads up to a newline from in. Used only on the interactive
650// confirmation path; bounded read so we don't hang on a closed stdin.
651func readLine(in io.Reader) string {
652 buf := make([]byte, 0, 64)
653 one := make([]byte, 1)
654 for {
655 n, err := in.Read(one)
656 if n == 0 || err != nil {
657 break
658 }
659 if one[0] == '\n' {
660 break
661 }
662 buf = append(buf, one[0])
663 if len(buf) > 1024 {
664 break
665 }
666 }
667 return string(buf)
668}
669
670// keepSortedNamesUsed is a compile-time guard against accidental dead
671// imports while iterating on the file. sort is referenced via this helper.

Callers 1

providerRemoveCommandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected