From b3593ecb3118177d272acb23c987404fb3110bef Mon Sep 17 00:00:00 2001 From: nexustar Date: Wed, 15 Mar 2023 19:16:44 +0800 Subject: [PATCH] add EB and EiB to size --- size.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/size.go b/size.go index c245a89..5b5056f 100644 --- a/size.go +++ b/size.go @@ -15,6 +15,7 @@ const ( GB = 1000 * MB TB = 1000 * GB PB = 1000 * TB + EB = 1000 * PB // Binary @@ -23,13 +24,14 @@ const ( GiB = 1024 * MiB TiB = 1024 * GiB PiB = 1024 * TiB + EiB = 1024 * PiB ) type unitMap map[byte]int64 var ( - decimalMap = unitMap{'k': KB, 'm': MB, 'g': GB, 't': TB, 'p': PB} - binaryMap = unitMap{'k': KiB, 'm': MiB, 'g': GiB, 't': TiB, 'p': PiB} + decimalMap = unitMap{'k': KB, 'm': MB, 'g': GB, 't': TB, 'p': PB, 'e': EB} + binaryMap = unitMap{'k': KiB, 'm': MiB, 'g': GiB, 't': TiB, 'p': PiB, 'e': EiB} ) var (