草庐IT

ServeJson

全部标签

go - Beego c.ServeJson() 返回空

这个问题在这里已经有了答案:JSONanddealingwithunexportedfields(2个答案)关闭4年前。我正在尝试在我的golang应用程序中将结构作为JSON返回,如此处所示Beegojsonreturnexample这是我的代码:typeRespJsonstruct{value1string`json:"value1"`value2string`json:"value2"`}func(c*ApiController)Prepare(){c.BaseController.Prepare()}func(c*ApiController)Post(){someData:=c