optimize code struct
This commit is contained in:
parent
2fdda76882
commit
7e15ea4169
@ -618,7 +618,8 @@ func eq(arg1 interface{}, arg2 ...interface{}) (bool, error) {
|
||||
default:
|
||||
return false, errBadComparison
|
||||
}
|
||||
} else {
|
||||
return true, nil
|
||||
}
|
||||
switch k1 {
|
||||
case boolKind:
|
||||
truth = v1.Bool() == v2.Bool()
|
||||
@ -633,12 +634,9 @@ func eq(arg1 interface{}, arg2 ...interface{}) (bool, error) {
|
||||
case uintKind:
|
||||
truth = v1.Uint() == v2.Uint()
|
||||
default:
|
||||
panic("invalid kind")
|
||||
}
|
||||
}
|
||||
if truth {
|
||||
return true, nil
|
||||
return false, errBadComparisonType
|
||||
}
|
||||
return truth, nil
|
||||
}
|
||||
return false, nil
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user