From e5b1c193795b51e9f8e9b72eacc058e06480f747 Mon Sep 17 00:00:00 2001 From: Tatsushi Inagaki Date: Tue, 25 Nov 2014 17:02:47 +0900 Subject: [PATCH] Fix to avoid a compilation error of size_test.go with GCCGO due to float to int truncation Signed-off-by: Tatsushi Inagaki --- units/size.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units/size.go b/units/size.go index 264f388..7cfb57b 100644 --- a/units/size.go +++ b/units/size.go @@ -39,7 +39,7 @@ var binaryAbbrs = []string{"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", // HumanSize returns a human-readable approximation of a size // using SI standard (eg. "44kB", "17MB") -func HumanSize(size int64) string { +func HumanSize(size float64) string { return intToString(float64(size), 1000.0, decimapAbbrs) }