Skip to content

Instantly share code, notes, and snippets.

@vladimirvivien
Last active September 13, 2017 16:11
Show Gist options
  • Save vladimirvivien/b8c9af58d501ad02fa66b65dae548078 to your computer and use it in GitHub Desktop.
Save vladimirvivien/b8c9af58d501ad02fa66b65dae548078 to your computer and use it in GitHub Desktop.
func main() {
file, err := os.Open("./proverbs.txt")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
defer file.Close()
p := make([]byte, 4)
for {
n, err := file.Read(p)
if err == io.EOF {
break
}
fmt.Print(string(p[:n]))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment