fix: range validation on mapping (#2317)
This commit is contained in:
@@ -311,10 +311,20 @@ func parseNumberRange(str string) (*numberRange, error) {
|
||||
right = math.MaxFloat64
|
||||
}
|
||||
|
||||
if left >= right {
|
||||
if left > right {
|
||||
return nil, errNumberRange
|
||||
}
|
||||
|
||||
// [2:2] valid
|
||||
// [2:2) invalid
|
||||
// (2:2] invalid
|
||||
// (2:2) invalid
|
||||
if left == right {
|
||||
if !leftInclude || !rightInclude {
|
||||
return nil, errNumberRange
|
||||
}
|
||||
}
|
||||
|
||||
return &numberRange{
|
||||
left: left,
|
||||
leftInclude: leftInclude,
|
||||
|
||||
Reference in New Issue
Block a user