We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
引用配置文件项传入的是字符串,容易出错。目前引用错误,也很难发现。希望能够在编译时进行检查,一旦引用错误,则编译失败。
The text was updated successfully, but these errors were encountered:
不存在的配置文件项是指什么?
Sorry, something went wrong.
是这样,我之前出过一个bug,拼接一个图片地址,是通过域名+图片名字的方式拼接。域名通过beego.AppConfig.String获得。当时配置文件有问题,没有获取到域名的值,所以图片上线后没有能够正常展示。
这种情况编译的时候没有问题。我想假如编译打包的时候能检测到调用了不存在的配置文件,这样子的问题就能在前期处理解决掉。
我的想法是通过beego/config包初始化配置文件,然后通过正则匹配到代码里面beego.AppConfig调用配置文件的值,然后匹配,如果引用了不存在的,就警告。还有一个想法,就是config包里面调用getdata的时候检查,如果在尝试引用不存在的配置项,发出警告,但是这样做的话警告有点多。
No branches or pull requests
引用配置文件项传入的是字符串,容易出错。目前引用错误,也很难发现。希望能够在编译时进行检查,一旦引用错误,则编译失败。
The text was updated successfully, but these errors were encountered: