mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 00:11:36 +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) {
|
||||
for {
|
||||
buf, err := r.ReadBytes('\n')
|
||||
fmt.Fprintf(os.Stdout, "%s", buf)
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
fmt.Fprintf(os.Stdout, "%s", buf)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user