Codebase list golang-github-vbauerster-mpb / b1f15c7
SizeB doc comments Vladimir Bauer 6 years ago
1 changed file(s) with 9 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
77 "strings"
88 )
99
10 //go:generate stringer -type=SizeB1024 -trimprefix=_i
11 //go:generate stringer -type=SizeB1000 -trimprefix=_
12
1013 const (
1114 _ib SizeB1024 = iota + 1
1215 _iKiB SizeB1024 = 1 << (iota * 10)
1518 _iTiB
1619 )
1720
18 //go:generate stringer -type=SizeB1024 -trimprefix=_i
21 // SizeB1024 named type, which implements fmt.Formatter interface. It
22 // adjusts its value according to byte size multiple by 1024 and appends
23 // appropriate size marker (KiB, MiB, GiB, TiB).
1924 type SizeB1024 int64
2025
2126 func (self SizeB1024) Format(st fmt.State, verb rune) {
7984 _TB SizeB1000 = _GB * 1000
8085 )
8186
82 //go:generate stringer -type=SizeB1000 -trimprefix=_
87 // SizeB1000 named type, which implements fmt.Formatter interface. It
88 // adjusts its value according to byte size multiple by 1000 and appends
89 // appropriate size marker (KB, MB, GB, TB).
8390 type SizeB1000 int64
8491
8592 func (self SizeB1000) Format(st fmt.State, verb rune) {