title: Golang reading multiple fields from stdin line
body: <pre><code>$ echo "A 1 2 3 4" | go run test.go 
  entire:  A
  next field:  A
  </code></pre>
  
  <p>I need to read several lines from standard input that are like "A 1 2 3 4" (code does one line for now) and something goes wrong. <code>Scanln</code> should read the entire line and <code>Fields</code> should split it by newlines? Why does Scanln read only one word?</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "strings"
  )
  
  func main() {
      var line string
      fmt.Scanln(&amp;line)
      fmt.Println("entire: ",line)
      for _,x := range strings.Fields(line) {
          fmt.Println("next field: ",x)
      }
  }
  </code></pre>
  
  <hr>
  
  <pre><code>$ echo "A 1 2 3 4" | go run test.go 
  entire:  A
  next field:  A
  </code></pre>