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:
@ -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":
|
||||
|
Reference in New Issue
Block a user