How do you use VSCode (Debugging, etc)?

agolangf · · 23 次点击    
<p>Hi everyone:</p> <p>I am just learning Go, and I realize that certain things are not completely obvious, like the best way to set up debugging. Can you walk through the specific ways you&#39;ve set up VSCode for Go -- including what you decided to do for debugging?</p> <p>Are there any other tips or tricks you have adopted to increase your productivity? (For example, a frequent point of complaints is that when commenting out code, compilation is halted if variables are only used a single time in the remaining code, for example. But a script can solve these, or other issues -- so if you use any such helper things, it would be nice to tell me about it.)</p> <p>I am trying to set up a streamlined Go process based on any feedback from how others have done it. Go is extremely productive and I&#39;ve only heard about one or two things - so my goal is to learn if anyone has solved these for themselves.</p> <p>Thank you.</p> <hr/>**评论:**<br/><br/>tristan957: <pre><p>Download the Go extension</p></pre>steffen25: <pre><p>Hey I dont know if this will help you but I remember campoy have this go tooling video that include go debugging with delve <a href="https://youtube.com/watch?v=uBjoTxosSys" rel="nofollow">https://youtube.com/watch?v=uBjoTxosSys</a> anyway it shows other cool go tools that is definitely worth to use in your go environment :) </p></pre>gomaleck13: <pre><p>With vscode I have done nothing more than downloading the go extension. The only complaint I have had is it is slow to find implementations of an interface or perform a refactor. Gogland offers improvements in this area, but it is much more resource intensive.</p></pre>sethammons: <pre><p>vs code will handle auto imports for you. If you comment out something and the import is no longer needed, it auto goes away. As for variable usage, you can get rid of unused variable errors by just adding &#39;_ = theVariable&#39; on the line after it. You can remove that line later. I tried wiring up the debugger a long time ago and failed. It is supposed to be easy now. I get pretty far with log statements and a verbose flag. I should look back into the debugger.</p></pre>Heyoni: <pre><p>Can I just say that I&#39;ve been using golang EAP and setting up the debugger was a breeze. It incorporates dlv (delve) into the GUI really nicely. I think it&#39;s free for now but will cost money once version 1.0 is out.</p></pre>nhooyr: <pre><p>I think you mean gogland and I completely agree. Replaced Neovim for me for go programming.</p></pre>iroflmaowtf: <pre><p>VSCode is highly inefficient, uses tons of memory for each opened file, I recommend looking at liteide</p></pre>sin2pifx: <pre><p>Documentation seems limited.</p></pre>iroflmaowtf: <pre><p>for what exactly?</p></pre>sin2pifx: <pre><p>Everything. Even installing is badly documented: it&#39;s just a link and it&#39;s anybody&#39;s guess what you have to download. Change logs seem to be have been left untranslated. </p> <p>There is no documentation about the editor, just some technical things about environment (and at least one image is missing) in bad English. This is the first sentence</p> <blockquote> <p>LiteIDE build config default use -i flag, if use Go1.1 or Go1.2 not support</p> </blockquote> <p>What does that mean?</p> <p>It didn&#39;t recognize my $GOPATH, and there&#39;s no way to find out where that&#39;s set. It&#39;s not in the preferences. Turns out it&#39;s a button in the tool bar, but I had to find out myself. What the other buttons do? No idea. How to build or run a project? How to run it with different arguments? Etc.</p> <p>These things matter. If someone looks up liteide and there is not enough information, they&#39;ll stop using it.</p></pre>iroflmaowtf: <pre><p>did you try to get it from <a href="https://sourceforge.net/projects/liteide/files/X32.2/" rel="nofollow">here</a>?</p> <p>there&#39;s a learning curve, no doubt, I think that&#39;s the case with every tool</p> <blockquote> <p>If someone looks up liteide and there is not enough information, they&#39;ll stop using it.</p> </blockquote> <p>it&#39;s your choice of course</p></pre>sin2pifx: <pre><p>Yes, that&#39;s what I got.</p> <blockquote> <p>it&#39;s your choice of course</p> </blockquote> <p>I&#39;ve tried it a bit, and it&#39;s a fast editor. Everyone who works on an underpowered laptop, should give it a try. A lot of work has been put in this tool, and it would be a shame if people discarded it because the documentation is lacking.</p></pre>Hexodam: <pre><p>I&#39;m trying to switch from LiteIDE to VSCode because thats what the cool kids are using and as much as I like the VSCode editor better than LiteIDE the whole simplicity and features of LiteIDE are hard to beat.</p> <p>Everyone who is starting out with Go should start with LiteIDE, takes so much pain away.</p></pre>iroflmaowtf: <pre><blockquote> <p>VSCode because thats what the cool kids are using</p> </blockquote> <p>I hear ya</p> <p>agree</p></pre>comrade-jim: <pre><p>By pretty much all bench marking standards VSCode is an inferior editor.</p> <p>The reason you hear about it so much is because Microsoft pays a marketing team (shills) to market the editor in programming communities. </p></pre>throwawaybeginr: <pre><p>This seems unlikely. Could you point to an actual example?</p></pre>sethammons: <pre><p>I was using sublime before vs code. I didn&#39;t care for atom. I moved to vs code after about 30 seconds of use programming Go with it. Functionality and features won me over. </p></pre>Killing_Spark: <pre><p>Inferior to what exactly? I thought its better then atom at least </p></pre>
23 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet