Skip to content

Instantly share code, notes, and snippets.

@audy
Created January 31, 2018 00:16
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 audy/8ee222ece46a0a4f7680bab7f24b15cc to your computer and use it in GitHub Desktop.
Save audy/8ee222ece46a0a4f7680bab7f24b15cc to your computer and use it in GitHub Desktop.
package main
import (
"os"
"fmt"
"bufio"
)
func main() {
inpath := os.Args[1]
file, err := os.Open(inpath)
if err != nil {
panic(err)
}
defer file.Close()
scanner := bufio.NewScanner(file)
for scanner.Scan() {
fmt.Println("--->" + scanner.Text())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment