What is the best Golang framework for webapps these days?

blov · · 561 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>A lot of people are saying to avoid iris. Then there is revel which looks fine, and I heard some just use the default framework golang provides.</p> <p>What do we think is the best option now? </p> <hr/>**评论:**<br/><br/>dlsniper: <pre><p>My vote is down for Buffalo, <a href="https://gobuffalo.io" rel="nofollow">https://gobuffalo.io</a></p> <p>If you <em>must</em> use a framework, then that&#39;s on the better side of them, the development is very active, the Slack channel on Gophers Slack is very helpful and the pace of development is really healthy.</p> <p>On top of those things, Buffalo is built on selected Go packages which are known to be stable, reliable, and follow Go&#39;s best practices.</p> <p>I&#39;m not dissing the other existing frameworks, the efforts others put into them are really nice (safe for iris, of course). However, Buffalo&#39;s holistic approach to web development seems to be gaining the minds of the gophers.</p> <p>Personally I use gorilla/mux and sqlx whenever I need to write something, but that&#39;s because I work exclusively with CLIs and API servers rather than anything client facing. </p> <p>Hope this helps.</p></pre>caseynashvegas: <pre><p>I&#39;d have to agree with <a href="/u/dlsniper" rel="nofollow">/u/dlsniper</a>. Buffalo seems to be the best of the breed out there. However I mostly use Gorilla Mux and a very highly forked version of SqlBoiler for an ORM, although anytime my SQL code get&#39;s more complex than &#34;pull this table or view either by ID or in full&#34; I usually write custom stored procedures. </p> <p>There is an prevailing wisdom that you should only use the standard library. I do feel it is mostly complete for a good amount of application needs, especially if you are doing a client side SPA or something with little complexity, I do feel like there is room for and solid use case for a framework like Buffalo. My advice is this, learn the standard library first, then evaluate your framework options. One thing I am big on is how easy and awesome middleware is built around the standard HttpHandler and HttpHandlerFunc, those are sacred, and if a framework breaks those, it better have a compelling use case as to why.</p></pre>RenegadeEagle: <pre><p>I watched the webcast on the homepage and this project looks fantastic. Thank you for the suggestion! </p></pre>zxo0oxz: <pre><p>Wow, buffalo seems like the sort of thing go people would usually be 1000% against. I personally don&#39;t feel that strongly about it, but I don&#39;t really use anything beyond gorilla either. I&#39;ll have to try it and see on my next small project.</p></pre>dlsniper: <pre><p>The question is about a framework. So rather than be unhelpful and say you don&#39;t need one, I came to the conclusion, thanks Brian Ketelsen for the talk, that probably it&#39;s better to be helpful. So yes, this is the one imho. </p></pre>jrmy: <pre><p>What’s your thoughts on sqlx and pop vs the straight sql package? </p> <p>I’ve been using httprouter and sql for the majority of our internal rest/protocol buffer api services. Every time a new one comes up I contemplate using sqlx or pop but never pull the trigger. </p></pre>dlsniper: <pre><p><code>sqlx</code> provides some pretty good, missing, features compared with <code>database/sql</code>.</p> <p><code>pop</code> takes things to a next level but I&#39;m stuck in the habit of writing my own SQL code always so I&#39;m not sure I can go back to that level.</p> <p>While I&#39;d include <code>sqlx</code> in the stdlib, I don&#39;t think I&#39;d include <code>pop</code> in it.</p> <p><code>httprouter</code> is also a pretty solid choice for the http routing part.</p></pre>qu33ksilver: <pre><p>I have been looking into kallax lately. <a href="https://github.com/src-d/go-kallax" rel="nofollow">https://github.com/src-d/go-kallax</a>. It&#39;s still new but the idea is nice.</p></pre>Telefonica46: <pre><p>This may not be applicable to you as it&#39;s more of a framework for rest api&#39;s than webapps, but I love goa. My typical project is a react spa front-end talking to a goa, rest api back-end. <a href="https://github.com/goadesign/goa" rel="nofollow">https://github.com/goadesign/goa</a></p></pre>usualdev: <pre><p>I just started with Go and I like Gin framework. Very easy to start with and good features (like binding JSON). According to their github it’s the fastest restful framework. I have tested a simple endpoint 2 days ago which does write post rescues to MySQL on my local machine and was able to serve 10k requests in 2 seconds</p></pre>cesarliws: <pre><p>I&#39;m enjoying to work with <a href="https://gobuffalo.io" rel="nofollow">https://gobuffalo.io</a> </p></pre>poofy_panda: <pre><p>How is goji mux?</p></pre>earthboundkid: <pre><p>I think Chi does basically the same things but it didn’t have to transition to using context because it started later. </p></pre>sybrandy: <pre><p>Not really a framework, but I&#39;ve loved using httprouter. It&#39;s just a mux, but I really never felt like I needed anything else.</p></pre>yashade2001: <pre><p>httprouter is enough..</p></pre>peacecwz: <pre><p>I think It&#39;s Iris Framework <a href="https://github.com/kataras/iris" rel="nofollow">https://github.com/kataras/iris</a></p></pre>ilikecaketoomuch: <pre><p>Author of that framework is a known to be problem child in the community.</p> <p><a href="https://news.ycombinator.com/item?id=11976798" rel="nofollow">https://news.ycombinator.com/item?id=11976798</a></p> <p>stay far away from it. He bought all his github stars according to a few users.</p></pre>FIuffyRabbit: <pre><p>He also has pawn reddit accounts that he will occasionally post under. Hence the op.</p> <p>Not to mention, he deletes all critical discussion from GitHub. </p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

561 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传