Skip to content

Instantly share code, notes, and snippets.

@larzconwell
Created September 6, 2012 00:09
Show Gist options
  • Save larzconwell/3648337 to your computer and use it in GitHub Desktop.
Save larzconwell/3648337 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"os"
)
func main() {
path := "/home/larz/Desktop/wut.txt"
// V This is the bugger I was having problems with
// V Was trying to to O_APPEND without giving write perms as well
// V
file, err := os.OpenFile(path, os.O_RDWR|os.O_APPEND, 0666)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
file.WriteString("sdlfkjsdsdfsdfsdffljksdflkj\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment