mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 18:36:41 +02:00
format: byte formatting test coverage (#8692)
Removed redundant checks and streamlined the switch-case structure. Added test cases for both HumanBytes and HumanBytes2 to cover a wide range of scenarios.
This commit is contained in:
parent
f00d359a67
commit
8d8b9f83ae
2 changed files with 91 additions and 2 deletions
|
@ -40,8 +40,6 @@ func HumanBytes(b int64) string {
|
|||
}
|
||||
|
||||
switch {
|
||||
case value >= 100:
|
||||
return fmt.Sprintf("%d %s", int(value), unit)
|
||||
case value >= 10:
|
||||
return fmt.Sprintf("%d %s", int(value), unit)
|
||||
case value != math.Trunc(value):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue