<hr/>**评论:**<br/><br/>mwholt: <pre><p>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 <a href="https://sourcegraph.com" rel="nofollow">Sourcegraph</a> which I highly recommend.</p>
<p>The more locally-scoped your variables are, the less trouble you will have remembering what their type is.</p></pre>Injunire: <pre><p>Also if using vim-go you can use :GoDef to jump right to where the variable is defined.</p></pre>v1rous: <pre><p>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.</p></pre>old_to_me_downvoter: <pre><p>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. </p></pre>adonovan76: <pre><p>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.</p></pre>forgiv: <pre><p>I try to name my variables in a way that makes the type more obvious.</p></pre>
I frequently need to go back and look up documentation or declarations to know the type of variables in my code. Am I doing something wrong?
agolangf · · 651 次点击这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传