type user struct {
name string
age int
}
func(u *user) say() {
// ...
}
func (*user) say(){ // if want anonymous instance name??
fmt.Println(ts.name, this.age); // the default `this` name can be both `ts` and `this` or something i like to name
}
func (u *user) whatever() { // then i also could define one
fmt.Println(u.name, u.age); // u overwrite using `ts` and `this`
}
// both code should work
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.