MCPcopy
hub / github.com/smallstep/cli / ReadString

Function ReadString

utils/read.go:44–51  ·  view source on GitHub ↗

ReadString reads one line from the given io.Reader.

(r io.Reader)

Source from the content-addressed store, hash-verified

42
43// ReadString reads one line from the given io.Reader.
44func ReadString(r io.Reader) (string, error) {
45 br := bufio.NewReader(r)
46 str, err := br.ReadString('\n')
47 if err != nil && err != io.EOF {
48 return "", errors.Wrap(err, "error reading string")
49 }
50 return strings.TrimSpace(str), nil
51}
52
53// ReadPasswordFromFile reads and returns the password from the given filename.
54// The contents of the file will be trimmed at the right.

Callers 6

inspectActionFunction · 0.92
verifyActionFunction · 0.92
inspectActionFunction · 0.92
verifyActionFunction · 0.92
DoManualAuthorizationMethod · 0.92
TestReadStringFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestReadStringFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…