瀏覽代碼

update 12.2.md (#510)

xin zhao 7 年之前
父節點
當前提交
f7ed339136
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      eBook/12.2.md

+ 3 - 2
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 {