Last active
April 25, 2021 16:31
-
-
Save Ramko9999/a3a280984ed2767cabdf9c6fc0dbd11d 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" | |
| ) | |
| /* | |
| Contents of test.txt: | |
| Hello World! | |
| */ | |
| func readFileContents(){ | |
| bytes, err := os.ReadFile("test.txt"); | |
| if err != nil { | |
| log.Fatal(err); | |
| } | |
| fileText = string(bytes[:]); // fileText is "Hello World!" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment