title: Golang nested class inside function
body: <p>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?</p>
  
  <pre><code>func f() {
      // nested struct Cls inside f
      type Cls struct {
      ...
      }
      // try bounding foo to Cls but fail
      func (c *Cls) foo() {
      ...
      }
  }
  </code></pre>
  
  <p>Thus it feels a bit strange that class is weaken inside function.</p>
  
  <p>Any hints?</p>