Revert "Upgrade to go 1.19 and update dependencies (#3069)" (#3085)

This reverts commit bba7c23957.
This commit is contained in:
WithoutPants
2022-11-07 12:33:15 +11:00
committed by GitHub
parent bba7c23957
commit 2609095c7a
939 changed files with 43785 additions and 101302 deletions

View File

@@ -122,19 +122,17 @@ func asNumber(t iterator, o interface{}) float64 {
return typ
case string:
v, err := strconv.ParseFloat(typ, 64)
if err == nil {
return v
if err != nil {
panic(errors.New("ceiling() function argument type must be a node-set or number"))
}
return v
}
return math.NaN()
return 0
}
// ceilingFunc is a XPath Node Set functions ceiling(node-set).
func ceilingFunc(q query, t iterator) interface{} {
val := asNumber(t, functionArgs(q).Evaluate(t))
// if math.IsNaN(val) {
// panic(errors.New("ceiling() function argument type must be a valid number"))
// }
return math.Ceil(val)
}