Last active
April 26, 2021 03:08
-
-
Save Ramko9999/7dfd1f55cd21c76360e75a39a5369a2c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import ( | |
| "log" | |
| "os" | |
| ) | |
| func writeFileContents() { | |
| content := "Something to write"; | |
| /* os.WriteFile takes in file path, a []byte of the file content, | |
| and permission bits in case file doesn't exist */ | |
| err := os.WriteFile("./test.txt", []byte(content), 0666); | |
| if err != nil { | |
| log.Fatal(err); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment