AppendStringToFile takes a path to a file and a string to append and it appends it, returning err
(path string, appendString string)
| 357 | // AppendStringToFile takes a path to a file and a string to append |
| 358 | // and it appends it, returning err |
| 359 | func 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 | |
| 372 | type XSymContents struct { |
| 373 | LinkLocation string |
no outgoing calls