MCPcopy Index your code
hub / github.com/ddev/ddev / AppendStringToFile

Function AppendStringToFile

pkg/fileutil/files.go:359–370  ·  view source on GitHub ↗

AppendStringToFile takes a path to a file and a string to append and it appends it, returning err

(path string, appendString string)

Source from the content-addressed store, hash-verified

357// AppendStringToFile takes a path to a file and a string to append
358// and it appends it, returning err
359func AppendStringToFile(path string, appendString string) error {
360 f, err := os.OpenFile(path,
361 os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
362 if err != nil {
363 return err
364 }
365 defer f.Close()
366 if _, err := f.WriteString(appendString); err != nil {
367 return err
368 }
369 return nil
370}
371
372type XSymContents struct {
373 LinkLocation string

Callers 5

TestCmdSSHFunction · 0.92
TestDebugRebuildCmdFunction · 0.92

Calls

no outgoing calls

Tested by 5

TestCmdSSHFunction · 0.74
TestDebugRebuildCmdFunction · 0.74