Skip to content

Instantly share code, notes, and snippets.

@hitechqb
Created September 15, 2019 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hitechqb/9227cb0f7599d527bb585814b50a8dd8 to your computer and use it in GitHub Desktop.
Save hitechqb/9227cb0f7599d527bb585814b50a8dd8 to your computer and use it in GitHub Desktop.
func ReadFile() {
filename := os.Getenv("fileExample")
file, err := os.Open(filename)
if err != nil {
return errors.Wrapf(err, "unable to open %s", filename)
}
defer file.Close()
count, err := count(bufio.NewReader(file))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment