beego 用golang 做http开发的框架

前端之家收集整理的这篇文章主要介绍了beego 用golang 做http开发的框架前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

官网 http://beego.me

直接在router.go 中写

beego.Any("/foo",func(ctx *context.Context) {
ctx.WriteString("hello world")
})

发现会报错

routers/router.go:12: undefined: context in context.Context


解决办法

import( "github.com/astaxie/beego/context" )

原文链接:https://www.f2er.com/go/190078.html

猜你在找的Go相关文章