Append To File In Golang

[Solved] Append To File In Golang | Go - Code Explorer | yomemimo.com
Question : append to file in golang

Answered by : spy16

f, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY|os.O_CREATE, 0600)
if err != nil { panic(err)
}
defer f.Close()
if _, err = f.WriteString(text); err != nil { panic(err)
}

Source : https://stackoverflow.com/questions/7151261/append-to-a-file-in-go | Last Update : Fri, 04 Dec 20

Answers related to append to file in golang

Code Explorer Popular Question For Go