-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go-units API is missing a method which would parse "32kB" as 32000 bytes, and "32kiB" as 32768 bytes. FromHumanSize() parses both as 32000 bytes, while RAMInBytes() parses both as 32768 bytes. This commit introduces a FromSize method a more litteral parsing of the unit is needed. Modifiers without a unit ('32k') will be assumed to be using a decimal unit, so they'll equivalent to 32 kB/32000 bytes. This fixes #31
- Loading branch information
Showing
2 changed files
with
69 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters