title: How to find EOF while reading from a file
body: <p>I am using the following code to read a file in Go:</p>
  
  <pre><code>spoon , err := ioutil.ReadFile(os.Args[1])
  if err!=nil {
          panic ("File reading error")
  }
  </code></pre>
  
  <p>Now I check for every byte I pick for what character it is. For example:</p>
  
  <pre><code>spoon[i]==' ' //for checking space
  </code></pre>
  
  <p>Likewise I read the whole file (I know there maybe other ways of reading it)
  but keeping this way intact, how can I know that I have reached EOF of the file and I should stop reading it further?</p>
  
  <p>Please don't suggest to find the length of <code>spoon</code> and start a loop. I want a sure shot way of finding EOF.</p>