mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 10:27:46 +08:00
* chore: apply go fix modernizers from Go 1.26
automated refactoring: interface{} to any, slices.Contains,
and other idiomatic updates.
* feat(ci): add `go fix` check to Go analysis workflow
ensures Go 1.26 modernizers are applied, fails CI if `go fix ./...`
produces any changes (similar to existing `go fmt` enforcement)
10 lines
178 B
Go
10 lines
178 B
Go
package testutils
|
|
|
|
func FloatTruncate(value float64, decimalPlaces int) float64 {
|
|
pow := 1.0
|
|
for range decimalPlaces {
|
|
pow *= 10.0
|
|
}
|
|
return float64(int(value*pow)) / pow
|
|
}
|