title: Reading from a text file in Golang?
body: <p>I want to do this:</p>
  
  <ol>
  <li>Read a line from a text file.</li>
  <li>Process the line.</li>
  <li>Delete the line.</li>
  </ol>
  
  <p>My first thought was to read the entire file into memory with <code>ioutil.Readfile()</code>,<br>
  but I'm not sure how to update the text file after the line has been processed,<br>
  and what happens if extra lines is added to the text file after it has been read into memory?</p>
  
  <p>I normally write shell scripts and would do something like this:</p>
  
  <pre><code>while read -r line; do
      echo "${line}"
      sed -i 1d "${myList}"
  done &lt; "${myList}"
  </code></pre>
  
  <p>What is the best way to do this in Golang?</p>