mirror of
https://github.com/golang/go
synced 2024-11-18 14:44:41 -07:00
ef1313dc6d
A common annoying mis-completion is as follows: type foo struct { field int } func (f foo) Field() int { return f.field } func (f foo) logic() { if f.f<> } Now at <> we prefer "field" over "Field()". Similarly: type foo struct { } func (f foo) DoSomething() { } func (f foo) doSomething() { } func (f foo) logic() { f.d<> } Now at <> we prefer "doSomething()" over "DoSomething()". All else being equally, you normally want private objects over public objects when the private objects are available. The same logic is applied to deep completions so we prefer "c.foo.bar" over "c.Foo().bar". Change-Id: Ic91cba7721ddb1f2a30338037693ddcce8c621f7 Reviewed-on: https://go-review.googlesource.com/c/tools/+/223877 Run-TryBot: Muir Manders <muir@mnd.rs> Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Rebecca Stambler <rstambler@golang.org> |
||
---|---|---|
.. | ||
indirect | ||
lsp | ||
missingdep | ||
missingtwodep | ||
unused | ||
upgradedep |