<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'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'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't need everything they provide, and would find you're better off just piecing together some libraries and making some decisions yourself. I'd tend to agree, because you'll find that approach is generally more flexible.</p>
<p>That'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're building though.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传