mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 04:48:29 +08:00
解决末行无法打印问题 (#783)
* 解决末行无法打印问题 * Apply suggestions from code review Co-authored-by: ᴜɴᴋɴᴡᴏɴ <u@gogs.io>
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user