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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Ask HN: What do you think is the current best Go webframework and why?

23 点作者 McMini超过 8 年前

5 条评论

twotwotwo超过 8 年前
Without making grand pronouncements about The Right Way, I at least get why the Go community shies away from all-inclusive frameworks after years of using Django. An all-inclusive framework is super helpful for getting started quickly, but the way its components can be deeply tied with each other can make life tricky when you want to do some things that weren&#x27;t quite what the framework authors envisioned. If you glued the components together yourself, you at least know they&#x27;re separable and where they fit together.<p>There are popular packages for the sorts of things that a lower-level Python framework might:<p>- <a href="http:&#x2F;&#x2F;www.gorillatoolkit.org&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.gorillatoolkit.org&#x2F;</a> has a more flexible router, sessions, and some other basics on the Web side<p>- Built-in html&#x2F;template is a pretty good place to start. (The context-aware escaping is something I wish I had.)<p>- Popular database tools include jmoiron&#x2F;sqlx and jinzhu&#x2F;gorm on GitHub.<p>- gokit.io is mostly about internal services rather than frontends, but may have parts of general interest. It includes example services.<p>- godoc.org links to a bunch of popular packages and has search and such. Incidentally, its own source is available: <a href="https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;gddo" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;golang&#x2F;gddo</a><p>I&#x27;d say Go is not going to get you to a releasable DB-backed Web app anywhere near as fast as Django or any of the other well-known dyn-language frameworks. I think the language has the bones where you could <i>get</i> that sort of app to faster time-to-first-usefulness, without entirely giving up the easy-to-follow-what&#x27;s-happening and pick-your-parts aspects, but probably not there now.
评论 #13348038 未加载
评论 #13349445 未加载
jwcrux超过 8 年前
I prefer just using the standard library with a muxer like gorilla&#x2F;mux.
评论 #13346198 未加载
评论 #13346195 未加载
eternalban超过 8 年前
OP&#x27;s question is far too broad to elicit useful answers.<p>Start with a feature list of what you require from the framework.<p><pre><code> - Validation - Routing - Security - Filtering - Templating - Data binding - Component reuse ...</code></pre>
platzhirsch超过 8 年前
I think the idea of a web framework in Go is too application level oriented where as Go is a great language to write infrastructure. If you implement a microservice, look for microservice frameworks. A web application itself seems to broad. I would almost always recommend to find a custom implementation.
erikb超过 8 年前
Really really close to flagging this. There is no &quot;best X&quot; for any X. At least not without adding lots of context (and then it gets boring for other people since these details probably are not interesting for them).
评论 #13346305 未加载
评论 #13346211 未加载