Last active
April 25, 2021 01:42
-
-
Save Ramko9999/7d4c4a89e739b03e2115545c6d1fe0f3 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 ( | |
| "os" | |
| ) | |
| func createFile(){ | |
| filePtr, err := os.Create("./test/creating.txt"); | |
| if err != nil { | |
| log.Fatal(err); | |
| } | |
| defer filePtr.Close(); // close the file | |
| // We can read from and write to the file | |
| } | |
| func openFile(){ | |
| filePtr, err := os.Open("./test/creating.txt"); | |
| if err != nil { | |
| log.Fatal(err); | |
| } | |
| defer filePtr.Close(); // close the file | |
| // We can read from and write to the file | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment