Just modify the field you want to change:
func (u *User) Modify() {
u.Name = "Paul"
}
This is covered well in the Go tour which you should definitely read through, it doesn’t take long.
Just modify the field you want to change:
func (u *User) Modify() {
u.Name = "Paul"
}
This is covered well in the Go tour which you should definitely read through, it doesn’t take long.