评论:
mwholt:
Injunire:No, but an editor with a Go plugin can help. Sublime: GoSublime+GoImports, Atom: GoPlus, Visual Studio Code: VScode-go. You can also use a editor-agnostic solution like Sourcegraph which I highly recommend.
The more locally-scoped your variables are, the less trouble you will have remembering what their type is.
v1rous:Also if using vim-go you can use :GoDef to jump right to where the variable is defined.
old_to_me_downvoter:Having programmed for over a decade, I can tell you there's nothing wrong with that! 60-80% of the time I spend "coding" is actually time spent googling, reading documentation, and just plain thinking.
adonovan76:Nothing wrong with having the only thing you've accomplished for the day is 5 lines of the absolute most perfect (for that situation) code after 7+ hours of research.
forgiv:You could try the Guru tool (godoc.org/golang.org/x/tools/cmd/guru), which plugs into many editors. Among other things, it can show the type (and fields and methods) of any expression you select.
I try to name my variables in a way that makes the type more obvious.
