Last active
December 21, 2015 20:19
-
-
Save tmtk75/6360740 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
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "os" | |
| ) | |
| func main() { | |
| file, err := os.Open("file_Scanner.go") | |
| defer file.Close() | |
| if err != nil { | |
| panic(err) | |
| } | |
| sc := bufio.NewScanner(file) | |
| for i := 0; sc.Scan(); i++ { | |
| fmt.Println(i, sc.Text()) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment