MCPcopy Create free account
hub / github.com/cli/cli / ReadFile

Function ReadFile

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

Source from the content-addressed store, hash-verified

7)
8
9func ReadFile(filename string, stdin io.ReadCloser) ([]byte, error) {
10 if filename == "-" {
11 b, err := io.ReadAll(stdin)
12 _ = stdin.Close()
13 return b, err
14 }
15
16 return os.ReadFile(filename)
17}
18
19// ReadMarkdownBodyFile reads Markdown from path and returns its base directory
20// for resolving local attachment references. Standard input has no base

Callers 11

resolveBodyFunction · 0.92
createRunFunction · 0.92
editRunFunction · 0.92
NewCmdCreateFunction · 0.92
NewCmdEditFunction · 0.92
createRunFunction · 0.92
importRunFunction · 0.92
NewCmdMergeFunction · 0.92
NewCmdRevertFunction · 0.92
NewCmdReviewFunction · 0.92
ReadMarkdownBodyFileFunction · 0.85

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected