title: How can I skip the first line of a file in Go?
body: <p>How can I read a file in Go and skip the first line / headers?</p>
  
  <p>In Python I know I could do</p>
  
  <pre><code>counter = 0
  with open("my_file_path", "r") as fo:
      try:
          next(fo)
      except:
          pass
      for _ in fo:
           counter = counter + 1
  </code></pre>
  
  <p>This is my Go application</p>
  
  <pre><code>package main    
  import (
      "bufio"
      "flag"
      "os"
  )
  
  func readFile(fileLocation string) int {
      fileOpen, _ := os.Open(fileLocation)
      defer fileOpen.Close()
      fileScanner := bufio.NewScanner(fileOpen)
  
      counter := 0
      for fileScanner.Scan() {
          //fmt.Println(fileScanner.Text())
          counter = counter + 1
      }
  
      return counter
  }
  
  func main() {
      fileLocation := flag.String("file_location", "default value", "file path to count lines")
      flag.Parse()
  
      counted := readFile(*fileLocation)
      println(counted)
  }
  </code></pre>
  
  <p>I will be reading a huge file and don't want to be evaluating each line if the index is 0.</p>