f, err := os.OpenFile("text.log",
os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
log.Println(err)
}
defer f.Close()
if _, err := f.WriteString("text to append\n"); err != nil {
log.Println(err)
}
Created
August 12, 2022 07:29
-
-
Save alidevhere/00f9d1ebc6fbe61f6bc2736f9a2ea6c8 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment