TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Go Debugging with Delve, or No More Fmt.Printfs

91 点作者 tpaschalis大约 5 年前

8 条评论

sn_master大约 5 年前
Coming to Go from C#, I was shocked at how poor the debugging experience was, even inside Google itself (I worked at GCP for less than a year).<p>I don&#x27;t get the mentality of people who don&#x27;t feel the importance and satisfaction of being able to step through their code line-by-line and see everything coming to life in a debugger window, even if its for sake of watching it, not for finding a code bug. Some people seem to never have used one for years and they take it as a sign of weakness if someone says they need one to find a bug rather than looking at the code.<p>I haven&#x27;t and if its up to me, I would never use Go again, just because of the piss poor debugging experience in a language that&#x27;s so new. Google engineer&#x27;s mentality is very old school and anyone who enjoyed the beauty of conditional breakpoints and step-through debugging in modern IDEs will know exactly what I am talking about. Go is so new yet built with incredibly ancient mentality.
评论 #22872735 未加载
评论 #22875141 未加载
评论 #22874208 未加载
zaphar大约 5 年前
I occasionally feel the need to use a debugger. But nothing beats the ease and power of the humble printf in all it&#x27;s forms in all languages. Sometimes you need a debugger. But you can get <i>really</i> far with just a printf.
leetrout大约 5 年前
Delve is great and debuggers in general are some of the best tools but to take the title at face value diminishes the value of the unassuming print facilities in every language.<p>There’s a time and place for proper debuggers and (more?) time and place for a simple print statement in my humble opinion.
mkchoi212大约 5 年前
I remember trying out Delve about a year ago while it was still in its infancy and don&#x27;t remember there being commands like `goroutines`; I may be wrong. The overall experience wasn&#x27;t all that good to be honest.<p>My initial impressions of delve was &quot;Oh it&#x27;s basically GDB for Go&quot;. But seems like the debugger has become more stable and more mature over the years by shipping language specific commands; like `goroutines`.
评论 #22868306 未加载
macrael大约 5 年前
The only thing I&#x27;ve seen that seems genuinely better than print debugging most of the time is the Playground concept, which is just print debugging automatically for every line of your program. Debuggers seem like they are useful sometimes, especially if it takes a lot to get into the state you want to debug, but focusing on making small rapid tests and printing lines that are interesting to you seems to keep me from ever actually bothering to setup delve.
评论 #22870320 未加载
评论 #22872696 未加载
tech_dreamer大约 5 年前
Go plugin for VS Code has first class support for delve (as well as Emacs) - I have been using it for more than a year!
评论 #22871726 未加载
d0100大约 5 年前
As a lifelong printf debugger in many languages, what I&#x27;d prefer is to be able to send my printf&#x27;s into different streams and have a scrollable, filterable and searchable console for each stream<p>Kinda like the console in web developer tools (F12)
评论 #22871608 未加载
评论 #22871270 未加载
btashton大约 5 年前
Does anyone have a good workflow for spanning go-&gt;cgo. I have found it very hard to code and debug in the space. I end up using gdb, but that lacks a lot of the go context and you cannot go into the c code with delve.
评论 #22870464 未加载