title: golang return first field from struct
body: <p>I am trying to return all user information given ONE attribute which can either be user_id, email, or name.</p>
  
  <pre><code>u := User{
   Email: "goda@go.com"
   })
  k := User {
  Name: "john"
  }
  
  ReturnUserInfo(u)
  ReturnUserInfo(k)
  </code></pre>
  
  <p>I invoke the function passing a User struct with only one field. Then I want to parse the field without EXPLICITLY saying the email. In the end I get the user information by passing an implicit field (user_id OR email etc.)</p>
  
  <pre><code>func ReturnUserInfo(u User) (y User){
      // Retrieve first field from u and set them to field and value.
      // NOT explicitly stating field := email, value := u.Email
  
      db, _ := sql.Open("mysql", "root:password@/users")
      _ := db.QueryRow("SELECT user_id, name, email FROM users WHERE ? = ?", field, value).Scan(
          &amp;u.User_id, &amp;u.Name, &amp;u.Email)
      y = User{
          User_id: u.User_id,
          Name: u.Name,
          Email: u.Email,
      }
      return y
  
  }
  </code></pre>
  
  <p>I am not sure if I am able to do this in Golang, but I am creating this function so I do not have to explicitly tell Go to look for a particular attribute to return a user's information.</p>