Created
September 6, 2012 00:09
-
-
Save larzconwell/3648337 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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