Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PadStringLeft ¶
Example: PadStringLeft("hello", "*", 8) returns "***hello"
Note: The function adds a space to the input string before padding to ensure proper alignment.
func PadStringRight ¶
PadStringRight pads the input string with the specified padChar on the right side until the string reaches the specified length. If the input string is already longer than or equal to the specified length, it returns the input string as is.
Parameters: - input: The original string to be padded. - padChar: The character to pad the input string with. - length: The desired total length of the output string.
Returns: - A new string that is padded with padChar on the right side to the specified length.
Example: PadStringRight("hello", "*", 8) returns "hello***"
Note: The function adds a space to the input string before padding to ensure proper alignment.
func SizeInBytes ¶
SizeInBytes converts a size in bytes to a human-readable string representation using binary prefixes (KiB, MiB, GiB).
Parameters: - size: The size in bytes to be converted.
Returns: - A string representing the size in a human-readable format with binary prefixes.
Example: SizeInBytes(1048576) returns "1.00 MiB"
Note: The function uses binary prefixes where 1 KiB = 1024 bytes, 1 MiB = 1024 KiB, and 1 GiB = 1024 MiB.
Types ¶
This section is empty.