Advertisement
cwchen

[Go] Error when reading files.

Oct 28th, 2017
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.17 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "log"
  5.     "os"
  6. )
  7.  
  8. func main() {
  9.     file, err := os.Open("file.txt")
  10.     if err != nil {
  11.         log.Fatal(err)
  12.     }
  13.  
  14.     // Do something on file object.
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement