title: Golang How to read input filename in Go
body: <p>I would like to run my go file on my <code>input.txt</code> where my go program will read the <code>input.txt</code> file when I type in go run command ie: </p>
  
  <pre><code>go run goFile.go input.txt
  </code></pre>
  
  <p>I don't want to put <code>input.txt</code> in my <code>goFile.go</code> code since my go file should run on any input name not just <code>input.txt</code>.</p>
  
  <p>I try <code>ioutil.ReadAll(os.Stdin)</code> but I need to change my command to</p>
  
  <pre><code>go run goFile.go &lt; input.txt
  </code></pre>
  
  <p>I only use package <code>fmt</code>, <code>os</code>, <code>bufio</code> and <code>io/ioutil</code>. Is it possible to do it without any other packages?</p>