Last active
August 29, 2015 14:05
-
-
Save freeeve/0f34676f9afec053915a to your computer and use it in GitHub Desktop.
This file contains 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() { | |
filename := os.Args[1] | |
file, err := os.Open(filename) | |
if err != nil { | |
panic(err) | |
} | |
r := bufio.NewReader(file) // the magic happens here | |
for { | |
line, err := r.ReadString('\n') | |
if err != nil { | |
fmt.Println(err) | |
break | |
} | |
fmt.Printf("%s", line) | |
} | |
} |
This file contains 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
An afternoon breeze | |
expels cold air, along with | |
the fallen brown leaves. | |
Cherry blossoms bloom, | |
softly falling from the tree, | |
explode into night. | |
地理 | |
湖沼 | |
ダム湖 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment