From f7ed339136fc6b0c49c9cbddb691b8e1548b9a7e Mon Sep 17 00:00:00 2001 From: xin zhao Date: Wed, 13 Jun 2018 21:42:32 +0800 Subject: [PATCH] update 12.2.md (#510) --- eBook/12.2.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eBook/12.2.md b/eBook/12.2.md index 4348eee..54321c1 100644 --- a/eBook/12.2.md +++ b/eBook/12.2.md @@ -8,6 +8,7 @@ ```go package main + import ( "bufio" "fmt" @@ -28,7 +29,7 @@ func main() { inputReader := bufio.NewReader(inputFile) for { inputString, readerError := inputReader.ReadString('\n') - fmt.Printf("The input was: %s", inputString) + fmt.Printf("The input was: %s", inputString) if readerError == io.EOF { return } @@ -71,7 +72,7 @@ func main() { if err != nil { fmt.Fprintf(os.Stderr, "File Error: %s\n", err) // panic(err.Error()) - } + } fmt.Printf("%s\n", string(buf)) err = ioutil.WriteFile(outputFile, buf, 0644) // oct, not hex if err != nil {