Go supports nested struct inside function but no nested function except lambda, does it mean there is no way to define a nested class inside function?
func f() {
// nested struct Cls inside f
type Cls struct {
...
}
// try bounding foo to Cls but fail
func (c *Cls) foo() {
...
}
}
Thus it feels a bit strange that class is weaken inside function.
Any hints?