Go Short Variable Declaration Invalid Cases

From NovaOrdis Knowledge Base
Revision as of 10:57, 4 April 2016 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

Internal

With Method Receivers' Fields

...

type A struct {
    i int
}

func (a A) m(i int) {
    a.i := i + 1 // invalid, the compiler will complain: ""
}
...