title: Looping result from SQL select query
body: <p>So am learning Go - Language atm 
  and I still confused on how do I iterate arraylist that I get from SQL when I execute my query</p>
  
  <p>here is for the detail</p>
  
  <p>I got a file named <strong>CustomerDao.go</strong>
  which contains a bunch of queries and the query I uses now is </p>
  
  <pre><code>SELECT mst_customer.mcus_mlok_pk , mst_customer.mcus_mlok_kode , mst_customer.mcus_nama FROM frontend.mst_customer;
  </code></pre>
  
  <p>which will return 50 rows of data and 3 columns yes?
  now the confusing part is when I reach my controller
  which is like this </p>
  
  <pre><code>func GetArrayListCustomer(queryType string) (map[string]CustomerModelResponse, error) {
      logger := customlogger.GetInstance()
      logger.Println("Service: GetArrayListCustomer Start")
  
      queryText := dao.CustomerDAO(queryType)
      res, err := config.GetDbByPath("myDatabase").GetDb().Query(queryText)
  
      mapList := make(map[string]CustomerModelResponse)
      var custResponse CustomerModelResponse
  
      if config.FancyHandleError(err) {
          logger.Println("Service: GetArrayListCustomer -&gt; Error " + err.Error())
          return mapList, err
      }
      defer res.Close()
      for res.Next() {
          errs := res.Scan(&amp;custResponse.McusmlokPk, &amp;custResponse.McusmlokKode, &amp;custResponse.McusNama)
          for _, eachCust := range res {
              //the error goes here , for some reason
          }
      }
      return mapList, nil
  }
  </code></pre>
  
  <p>and then I try to loop the value then the error show that I cannot range over res which is a *sql.Rows how do I declare those result as an array not as a *sql.Rows type?</p>