title: how can I take input from user in Golang (fmt.scan)
body: <p>I can not take input from the user in <strong>Golang</strong> by use <code>fmt.scan()</code>.</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
      fmt.Print("Enter text: ")
      var input string
      e, _ := fmt.Scanln(&amp;input)
      fmt.Println(input)
      fmt.Println(e)
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/95JcH.png" rel="nofollow noreferrer">image of code</a></p>
  
  <p>After stopping the debugger:
  <a href="https://i.stack.imgur.com/miiCS.png" rel="nofollow noreferrer">image of code</a>
  The <code>err</code> added to code, but nothing happened.</p>
  
  <pre><code>func main() {
      fmt.Print("Enter text: ")
      var input string
      e, err := fmt.Scanln(&amp;input)
      if err != nil {
          fmt.Fprintln(os.Stderr, err)
          return
      }
      fmt.Println(input)
      fmt.Println(e)
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/VtsbD.png" rel="nofollow noreferrer">Image after add err in my Code.</a> What is "not available" in Next line (after my Input value: "51213")</p>