解决末行无法打印问题 (#783)

* 解决末行无法打印问题

* Apply suggestions from code review

Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
This commit is contained in:
romantic艾克
2020-12-12 10:36:11 +08:00
committed by GitHub
parent 806880974d
commit 00a657e192

View File

@@ -20,10 +20,10 @@ import (
func cat(r *bufio.Reader) { func cat(r *bufio.Reader) {
for { for {
buf, err := r.ReadBytes('\n') buf, err := r.ReadBytes('\n')
fmt.Fprintf(os.Stdout, "%s", buf)
if err == io.EOF { if err == io.EOF {
break break
} }
fmt.Fprintf(os.Stdout, "%s", buf)
} }
return return
} }