title: gorm for mysql: record not found
body: <pre><code> // for trade_service
   type AmountConfig struct {
      MaxCny float64 `thrift:"max_cny,1" json:"max_cny"`
      MaxBtc float64 `thrift:"max_btc,2" json:"max_btc"`
    }
    //
  
  type AmountConfig struct {
       gorm.Model
       trade_service.AmountConfig  //
  }
  
  
  
  func getAmountConfig() (amount_config *trade_service.AmountConfig, err error) {
      db, err := getORMDB()
      if err != nil {
        logger.Errorln(err)
        return
      }
  
      var amountConfig AmountConfig{}
  
      if err = db.First(&amp;amountConfig).Error; err != nil {
          logger.Errorln("getAmountConfig amount record does not exist:", err)
          return
      }
  
      amount_config = trade_service.NewAmountConfig()
      amount_config.MaxCny = amountConfig.MaxCny
      amount_config.MaxBtc = amountConfig.MaxBtc
  
      logger.Infoln("get amountConfig ok", amount_config)
  
      return
  }
  </code></pre>
  
  <p>mysql table described as follow:  </p>
  
  <pre><code>CREATE TABLE `amount_config` ( 
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `max_cny` decimal(65,2) DEFAULT NULL,
   `max_btc` decimal(65,4) DEFAULT NULL,
   `created_at` datetime DEFAULT NULL,
   `deleted_at` datetime DEFAULT NULL, 
   `updated_at` datetime DEFAULT NULL,
    PRIMARY KEY (`id`), 
    KEY `updated_at` (`updated_at`),  
    KEY `created_at` (`created_at`),
    KEY `deleted_at` (`deleted_at`) 
    ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>I had a record in talbe "amount_config", but error displayed "record not found" , after I run the code "db.First(&amp;amountConfig)".<br>
  Is there something wrong with my code ? </p>