title: Get Selected value from Golang Gorm Query
body: <p>I want to get user data after I do query using gorm</p>
  <pre><code>item := []models.User{}
  
  if config.DB.First(&amp;item, &quot;email = ?&quot;, email).RecordNotFound() || len(item) == 0 {
      c.JSON(500, gin.H{
          &quot;status&quot;:  &quot;error&quot;,
          &quot;message&quot;: &quot;record not found&quot;})
      c.Abort()
      return
  }
  
  c.JSON(200, gin.H{
      &quot;status&quot;: &quot;success&quot;,
      &quot;data&quot;:   item,
  })
  </code></pre>
  <p>And here are my models</p>
  <pre><code>type User struct {
  gorm.Model
  Stores     []Store // to show that customer can have many stores
  UserName   string
  FullName   string
  Email      string `gorm:&quot;unique_index&quot;`
  Password   string
  SocialID   string
  Provider   string
  Avatar     string
  Role       bool `gorm:&quot;default:0&quot;`
  HaveStore  bool `gorm:&quot;default:0&quot;`
  isActivate bool `gorm:&quot;default:0&quot;`
  }
  </code></pre>
  <p>I just want to get the UserName after do query from gorm, how to get that? I'm using <code>item.Username</code>but, the error show that <code>item.UserName undefined (type []models.User has no field or method UserName)</code></p>