net/http vs web frameworks?

agolangf · · 427 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Currently I am writing a web application, and I use net/http for most of the tasks and it seems sufficient. But the advice around web seems to be for web frameworks. Can someone tell me what are the advantages I will be getting using a framework, rather than net/http?</p> <p>I don&#39;t want to start a religious war over this. I am sure both have pros/cons - but what are they?</p> <hr/>**评论:**<br/><br/>deusmetallum: <pre><p>The frameworks will have solved a lot of problems for you, such as sessions, csrf, logging, etc. However, if you don&#39;t need those problems solved, then net/http is absolutely fine.</p></pre>SeerUD: <pre><p>A lot of the time, Gophers are steered away from web frameworks. More often than not you don&#39;t need everything they provide, and would find you&#39;re better off just piecing together some libraries and making some decisions yourself. I&#39;d tend to agree, because you&#39;ll find that approach is generally more flexible.</p> <p>That&#39;s not always the case though; and frameworks can solve a lot of really common problems. It just depends on if you want to work within the constraints of a given framework. It really depends on what you&#39;re building though.</p></pre>

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

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