Skip to content

Instantly share code, notes, and snippets.

@lachlan-eagling
Created October 12, 2019 01:50
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 lachlan-eagling/5068de70a243b3d2bcf987a83b6b9915 to your computer and use it in GitHub Desktop.
Save lachlan-eagling/5068de70a243b3d2bcf987a83b6b9915 to your computer and use it in GitHub Desktop.
Blog - Anatomy of a Struct (Using Struct)
func main() {
user := User{
firstName: "Lachlan",
lastName: "Eagling",
username: "LachlanEagling",
age: 7,
}
if err := user.UpdateUsername("Lachlan_E"); err != nil {
fmt.Println(err)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment