title: How to call gorm alias properly?
body: <p>Here is my code:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
      "time"
  
      "github.com/jinzhu/gorm"
      _ "github.com/jinzhu/gorm/dialects/sqlite"
  )
  
  type ClientCustomer struct {
      Id       int `json:"Id"`
      Name     string
      Created  time.Time
      key      string
      UserId   int `gorm:"user_id"`
      Modified time.Time
  }
  
  func (ClientCustomer) TableName() string {
      return "Client_customer"
  }
  
  type ClientCustomerInvitation struct {
      Id               int
      CustomerId       int `gorm:"customer_id"`
      CodeInvitationId int `gorm:"codeinvitation_id"`
  }
  
  func (ClientCustomerInvitation) TableName() string {
      return "Client_customer_invitation"
  }
  
  func main() {
      db, err := gorm.Open("sqlite3", "db.sqlite3?cache=shared&amp;mode=rwc")
      if err != nil {
          panic("failed to connect database")
      }
      defer db.Close()
      var clientCustomer ClientCustomer
      rows, err := db.Model(&amp;ClientCustomer{}).Rows()
      defer rows.Close()
      if err != nil {
          panic(err)
      }
      var clientCustomerInvitation ClientCustomerInvitation
      for rows.Next() {
          db.ScanRows(rows, &amp;clientCustomer)
          db.First(&amp;clientCustomerInvitation, "customer_id = ?", clientCustomer.Id)
          fmt.Println(clientCustomer)
          fmt.Println(clientCustomerInvitation)
  
      }
  
  }
  </code></pre>
  
  <p>but I'm not fond of this line: </p>
  
  <pre><code>db.First(&amp;clientCustomerInvitation, "customer_id = ?", clientCustomer.Id)
  </code></pre>
  
  <p>Is there a way to call "customer_id"  from the struct directly instead of using a string?</p>
  
  <p>Ideally I would like to do something like:</p>
  
  <pre><code> db.First(&amp;clientCustomerInvitation, ClientCustomerInvitation.CustomerId.gormAlias+" = ?", clientCustomer.Id)
  </code></pre>
  
  <p>I'm looking for a way to use the gorm alias for mapping the field in way that is more elegant and re usable than a mere string.</p>