fuelprices/vendor/github.com/antchfx/xpath/func_pre_go110.go

23 lines
374 B
Go
Raw Normal View History

2019-06-05 22:57:38 +02:00
// +build !go1.10
package xpath
2020-12-04 20:36:22 +01:00
import (
"bytes"
"math"
)
2019-06-05 22:57:38 +02:00
// math.Round() is supported by Go 1.10+,
// This method just compatible for version <1.10.
// https://github.com/golang/go/issues/20100
func round(f float64) int {
if math.Abs(f) < 0.5 {
return 0
}
return int(f + math.Copysign(0.5, f))
}
2020-12-04 20:36:22 +01:00
func newStringBuilder() stringBuilder {
return &bytes.Buffer{}
}