MCPcopy Index your code
hub / github.com/coder/coder / Read

Method Read

cli/config/file.go:99–105  ·  view source on GitHub ↗

Read reads the file to a string. All leading and trailing whitespace is removed.

()

Source from the content-addressed store, hash-verified

97// Read reads the file to a string. All leading and trailing whitespace
98// is removed.
99func (f File) Read() (string, error) {
100 if f == "" {
101 return "", xerrors.Errorf("empty file path")
102 }
103 byt, err := read(string(f))
104 return strings.TrimSpace(string(byt)), err
105}
106
107// open opens a file in the configuration directory,
108// creating all intermediate directories.

Callers

nothing calls this directly

Calls 2

readFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected