1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-07 02:10:17 +00:00

Merge pull request #1010 from BlackLee/master

add compare_not/not_nil methods for template
This commit is contained in:
astaxie
2015-02-14 20:31:18 +08:00
3 changed files with 21 additions and 1 deletions

View File

@ -139,6 +139,14 @@ func Compare(a, b interface{}) (equal bool) {
return
}
func CompareNot(a, b interface{}) (equal bool) {
return ! Compare(a, b)
}
func NotNil(a interface{}) (is_nil bool) {
return CompareNot(a, nil)
}
func Config(returnType, key string, defaultVal interface{}) (value interface{}, err error) {
switch returnType {
case "String":