labstack / gommon

Common packages for Go
MIT License
539 stars 101 forks source link

Rename binary units according to IEC 60027 and add decimal units (SI) #45

Closed muXxer closed 2 years ago

muXxer commented 3 years ago

This PR fixes #28

muXxer commented 3 years ago

@vishr maybe you can have a look at this PR? :) Thank you! :)

muXxer commented 2 years ago

4 months pending? :(

aldas commented 2 years ago

@muXxer it looks good but please change both Format() method signatures back as they were and I will merge this PR. This is unnecessary breaking change. If you know which PrefixType you want - you can call specific method also.

muXxer commented 2 years ago

Oh I just saw your comment now @aldas :sweat_smile:

Is it really a breaking change, since the method signatures were extended by a variadic parameter? If you don't pass the variadic parameter, it defaults back to the former behaviour.

aldas commented 2 years ago

This is unlikely but if someone has made interface for Bytes.Format(b int64) string that previous Bytes struct satisfied with its public method - then this is a breaking change.

muXxer commented 2 years ago

@aldas Sorry it took so long, almost forgot about that PR :) Shouldn't be breaking now in terms of public methods.

codecov-commenter commented 2 years ago

Codecov Report

Merging #45 (ad3d548) into master (4919956) will increase coverage by 1.37%. The diff coverage is 92.22%.

@@            Coverage Diff             @@
##           master      #45      +/-   ##
==========================================
+ Coverage   59.26%   60.64%   +1.37%     
==========================================
  Files           6        6              
  Lines         518      625     +107     
==========================================
+ Hits          307      379      +72     
- Misses        208      242      +34     
- Partials        3        4       +1     
Impacted Files Coverage Δ
bytes/bytes.go 88.97% <92.22%> (-7.52%) :arrow_down:
color/color.go 88.00% <0.00%> (-0.36%) :arrow_down:
email/email.go 0.00% <0.00%> (ø)
random/random.go 100.00% <0.00%> (ø)
log/log.go 52.94% <0.00%> (+1.99%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4919956...ad3d548. Read the comment docs.

aldas commented 2 years ago

better late than never