MCPcopy
hub / github.com/cli/cli / ReadFile

Function ReadFile

pkg/cmdutil/file_input.go:8–16  ·  view source on GitHub ↗
(filename string, stdin io.ReadCloser)

Source from the content-addressed store, hash-verified

6)
7
8func ReadFile(filename string, stdin io.ReadCloser) ([]byte, error) {
9 if filename == "-" {
10 b, err := io.ReadAll(stdin)
11 _ = stdin.Close()
12 return b, err
13 }
14
15 return os.ReadFile(filename)
16}

Callers 15

resolveBodyFunction · 0.92
createRunFunction · 0.92
editRunFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdEditFunction · 0.92
createRunFunction · 0.92
NewCmdCommentFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdEditFunction · 0.92
importRunFunction · 0.92
NewCmdMergeFunction · 0.92
NewCmdCommentFunction · 0.92

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected