“未定义:beego.AppConfig中的beego”-如何访问Beego配置参数

“未定义:beego.AppConfig中的beego”-如何访问Beego配置参数

问题描述:

As proposed here http://beego.me/docs/mvc/controller/config.md, I add parameters for MySQL user/password and when trying to access them (for example by using

beego.AppConfig.String("mysqluser"))

I get an "undefined: beego in beego.AppConfig" message. Any suggestions?

如此处 http://beego.me/docs/mvc/controller/config.md ,我为MySQL用户/密码以及尝试访问它们时添加了参数(例如,使用

beego.AppConfig.String("mysqluser“) code>) p>

我得到一个” undefined:beego in beego.AppConfig” code>消息。 有什么建议吗? p> div>

That was caused by a stupid mistake... I forgot to add the beego package... Try the following:

import "github.com/astaxie/beego"