title: How to access gorm.Model.ID?
body: <p>So gorm.Model provides some base properties or fields:</p>
  
  <pre><code>ID        uint       `json:"-" gorm:"primary_key"`
  CreatedAt time.Time  `json:"-"`
  UpdatedAt time.Time  `json:"-"`
  DeletedAt *time.Time `json:"-" sql:"index"`
  </code></pre>
  
  <p>and you can use it as so</p>
  
  <pre><code>type User struct {
    gorm.Model
    Name         string
    Email        string  `gorm:"type:varchar(100);unique_index"`
    Role         string  `gorm:"size:255"` // set field size to 255
  
  }
  </code></pre>
  
  <p>So when I was working on my Model Controller(s) for delete (or anything where I needed to compare the ID)</p>
  
  <p>This does not work, give me an error:</p>
  
  <pre><code>c.Ctx.DB.Delete(&amp;models.Address{ID: id})
  </code></pre>
  
  <blockquote>
    <p>unknown field 'ID' in struct literal of type
    github.com/NlaakStudios/PASIT/models".Address</p>
  </blockquote>
  
  <p>And, this does not work, give me an error:</p>
  
  <pre><code> c.Ctx.DB.Delete(&amp;models.Address{gorm.Model.ID: id})
  </code></pre>
  
  <blockquote>
    <p>invalid field name gorm.Model.ID in struct initializer id int</p>
  </blockquote>
  
  <p>If I remove the gorm.Model and define the field myself in each model ... it works.</p>
  
  <pre><code>type User struct {
  ID        uint       `json:"-" gorm:"primary_key"`
  CreatedAt time.Time  `json:"-"`
  UpdatedAt time.Time  `json:"-"`
  DeletedAt *time.Time `json:"-" sql:"index"`
    Name         string
    Email        string  `gorm:"type:varchar(100);unique_index"`
    Role         string  `gorm:"size:255"` // set field size to 255
  }
  </code></pre>
  
  <p>How do I access those four base fields?</p>