Style fixes from go vet.

This commit is contained in:
Andrey Smirnov
2015-02-22 14:36:14 +03:00
parent 903d4cefba
commit 618d06678c
6 changed files with 9 additions and 10 deletions
+4 -4
View File
@@ -8,13 +8,13 @@ import (
func HumanBytes(i int64) (result string) {
switch {
case i > (512 * 1024 * 1024 * 1024):
result = fmt.Sprintf("%#.02f TiB", float64(i)/1024/1024/1024/1024)
result = fmt.Sprintf("%.02f TiB", float64(i)/1024/1024/1024/1024)
case i > (512 * 1024 * 1024):
result = fmt.Sprintf("%#.02f GiB", float64(i)/1024/1024/1024)
result = fmt.Sprintf("%.02f GiB", float64(i)/1024/1024/1024)
case i > (512 * 1024):
result = fmt.Sprintf("%#.02f MiB", float64(i)/1024/1024)
result = fmt.Sprintf("%.02f MiB", float64(i)/1024/1024)
case i > 512:
result = fmt.Sprintf("%#.02f KiB", float64(i)/1024)
result = fmt.Sprintf("%.02f KiB", float64(i)/1024)
default:
result = fmt.Sprintf("%d B", i)
}