BytesString formats the given value as bytes with the unit provided from the environment.
(b T)
| 58 | |
| 59 | // BytesString formats the given value as bytes with the unit provided from the environment. |
| 60 | func BytesString[T realNumber](b T) string { |
| 61 | if v, _ := strconv.ParseBool(os.Getenv(bytesStringBase2Envar)); v { |
| 62 | return BytesStringBase2(b) |
| 63 | } |
| 64 | |
| 65 | return BytesStringBase10(b) |
| 66 | } |
| 67 | |
| 68 | // BytesPerSecondsString formats the given value bytes per second with the appropriate base-10 suffix (KB/s, MB/s, GB/s, ...) |
| 69 | func BytesPerSecondsString[T realNumber](bps T) string { |