Skip to content

Instantly share code, notes, and snippets.

@shanev
Last active January 21, 2019 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanev/16b20f164b78a335d6917dc230602a14 to your computer and use it in GitHub Desktop.
Save shanev/16b20f164b78a335d6917dc230602a14 to your computer and use it in GitHub Desktop.
// Finds a Profile by the given username
func (c *Client) ProfileByUsername(username string) (Profile, error) {
profile := new(Profile)
err := c.Model(profile).Where("username = ?", username).Select()
if err != nil {
return *profile, err
}
return *profile, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment