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

Function write

cli/config/file.go:118–126  ·  view source on GitHub ↗
(path string, mode os.FileMode, dat []byte)

Source from the content-addressed store, hash-verified

116}
117
118func write(path string, mode os.FileMode, dat []byte) error {
119 fi, err := open(path, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, mode)
120 if err != nil {
121 return err
122 }
123 defer fi.Close()
124 _, err = fi.Write(dat)
125 return err
126}
127
128func read(path string) ([]byte, error) {
129 fi, err := open(path, os.O_RDONLY, 0)

Callers 3

WriteMethod · 0.70
ExtractAPIKeyFunction · 0.50
renderManualTitlePromptFunction · 0.50

Calls 3

openFunction · 0.70
CloseMethod · 0.65
WriteMethod · 0.65

Tested by

no test coverage detected