title: sql: Scan error on column index 38: destination not a pointer
body: <p>Using Golang and the built in <code>database/sql</code> library and the postgres <code>lib/pq</code> library, I'm trying to read from a database that has some null values in some of the records. the code compiles, but when I try to run it I get the following error. </p>
  
  <pre><code>sql: Scan error on column index 38: destination not a pointer
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>  rows, err := db.Query(`SELECT * FROM observations WHERE profile_id=$1 AND year=$2 AND month=$3`, id, date.Year(), int(date.Month()))
    if err != nil {
      log.Fatal(err)
    }
    defer rows.Close()
    for rows.Next() {
      var id sql.NullInt64
      var year sql.NullInt64
      var month sql.NullInt64
      var day_of_week sql.NullInt64 
      var hour sql.NullInt64
      var profile_id sql.NullInt64 
      var created_at time.Time 
      var updated_at time.Time
      var banking sql.NullFloat64
      var hlt_pro sql.NullFloat64 
      var sup_shp sql.NullFloat64 
      var aff_con sql.NullFloat64 
      var biz_trv sql.NullFloat64 
      var investing sql.NullFloat64 
      var day_com sql.NullFloat64 
      var unique_emin sql.NullFloat64 
      var no_group sql.NullFloat64 
      var movie_goer sql.NullFloat64 
      var luxury_shopper sql.NullFloat64 
      var sports_fan sql.NullFloat64 
      var aland sql.NullInt64
      var awater sql.NullInt64
      var tractce sql.NullString
      var geoid sql.NullString
      var median_income sql.NullInt64 
      var total_population sql.NullInt64 
      var white sql.NullInt64 
      var black sql.NullInt64 
      var native_american sql.NullInt64 
      var asian sql.NullInt64 
      var pacific_islander sql.NullInt64 
      var other sql.NullInt64 
      var two_plus sql.NullInt64 
      var two_plus_question sql.NullInt64 
      var confused sql.NullInt64 
      var median_age sql.NullFloat64
      var count sql.NullFloat64
      var latitude sql.NullString
      var longitude sql.NullString
      if err := rows.Scan(&amp;id, &amp;year, &amp;month, &amp;day_of_week, &amp;hour, &amp;profile_id, &amp;created_at, &amp;updated_at, &amp;banking, &amp;hlt_pro, &amp;sup_shp, &amp;aff_con, &amp;biz_trv, &amp;investing, &amp;day_com, &amp;unique_emin, &amp;no_group, &amp;movie_goer, &amp;luxury_shopper, &amp;sports_fan, &amp;aland, &amp;awater, &amp;tractce, &amp;geoid, &amp;median_income, &amp;total_population, &amp;white, &amp;black, &amp;native_american, &amp;asian, &amp;pacific_islander, &amp;other, &amp;two_plus, &amp;two_plus_question, &amp;confused, &amp;median_age, &amp;count, &amp;latitude, longitude); err != nil {
        log.Fatal(err)
      }
      fmt.Println(id, year, month, day_of_week, hour, profile_id, created_at, updated_at, banking, hlt_pro, sup_shp, aff_con, biz_trv, investing, day_com, unique_emin, no_group, movie_goer, luxury_shopper, sports_fan, aland, awater, tractce, geoid, median_income, total_population, white, black, native_american, asian, pacific_islander, other, two_plus, two_plus_question, confused, median_age, count, latitude, longitude)
  
    }
    if err := rows.Err(); err != nil {
      log.Fatal(err)
    }
  </code></pre>
  
  <p>I'm using <code>sql.NullType</code>, which is the same as doing <code>*type</code>. This is an effort handle the null situation, and it seems to be working for most columns, but I'm not sure why it's saying "destination not a pointer". Also, I have no idea which variable is the problem. Any ideas?</p>