用了golang框架是否降低了开发效率

tablecell · · 1975 次点击
看不懂楼主在说什么... 例子的代码和测试完全不符合, 一个监听80端口, 一个访问8080...
#1
更多评论
1楼 <a href="/user/focusonline" title="@focusonline">@focusonline</a> 8080是另外一个框架的端口,完整的代码 ``` package main import &#34;github.com/yarf-framework/yarf&#34; type Hello struct { yarf.Resource } func (h *Hello) Get(c *yarf.Context) error { c.Render(&#34;Hello, &#34; + c.Param(&#34;name&#34;)) return nil } func main() { y := yarf.New() hello := new(Hello) y.Add(&#34;/hello/:name&#34;, hello) y.Start(&#34;:8080&#34;) } ``` $ http://localhost:8080/hello/world/
#2
你的用法不对, 你这里是把name当path使用了, $curl http://localhost:8080/hello/name/ 但是你定的不是这样的 /hello/:name 尾部增加一个/结果是不一样的?
#3