Add blank case for convertUnit

Assumes that it's in bytes. On my system (Arch Linux), values of 0 have
no unit printed next to them.
This commit is contained in:
Ian Adam Naval 2014-09-16 21:55:37 -04:00
parent fb8165fa80
commit d621f8d765

View File

@ -23,8 +23,10 @@ func convertUnit(stringUnit string) (jsh.Unit, error) {
return jsh.GB, nil
case "tB":
return jsh.TB, nil
case "":
return jsh.B, nil
default:
return 0, errors.New(fmt.Sprintln("Unknown unit %s", stringUnit))
return 0, errors.New(fmt.Sprintf("Unknown unit: %s\n", stringUnit))
}
}