title: How to check if a file is a valid image?
body: <p>I am building a web application.</p>
  
  <p>On one of the pages there is an upload form, where user can upload a file. After the upload is done, I want to check on the server if the uploaded file is an image.</p>
  
  <p>Is it possible to check this beyond simple file extension checking (i.e. not assuming that a <code>*.png</code> filename is actually a PNG image)?</p>
  
  <p>For example, if I edit a JPEG image adding/editing a byte in a random place to make an invalid JPEG file, I want to detect that it is not a JPEG image anymore. I used to do such type of thing via PHP some time ago, using a GD library.</p>
  
  <p>I would like to know if it is possible to do with Go?</p>