tag:github.com,2008:https://github.com/iamlongalong/bytesizer/releasesRelease notes from bytesizer2024-03-12T05:36:48Ztag:github.com,2008:Repository/770690653/v1.0.12024-03-12T05:36:48Zv1.0.1<p>release v1.0.1</p>kuhahalongtag:github.com,2008:Repository/770690653/v1.0.02024-03-12T05:27:54Zv1.0.0<h1>🚀 bytesizer v1.0.0 Release Notes</h1>
<p>We're thrilled to roll out bytesizer v1.0.0! 🥳 This first official release packs a nifty set of features for handling and converting byte sizes with ease in Go.</p>
<h2>What's New? 🤔</h2>
<ul>
<li><strong>Units Galore</strong>: Constants for Bytes, KB, MB, etc., at your service.</li>
<li><strong>Smart Calc</strong>: Zap! Convert <code>[]byte</code> to <code>ByteSize</code> in an instant.</li>
<li><strong>Pretty Print</strong>: Make <code>ByteSize</code> readable with <code>.String()</code> - no more squinting!</li>
<li><strong>Transform</strong>: Switch between bytes, KBs, MBs, and more, both as <code>float64</code> and <code>int</code>.</li>
<li><strong>Parse Power</strong>: Turn those "10KB" strings into <code>ByteSize</code> values without breaking a sweat.</li>
<li><strong>Doc Delight</strong>: Everything's explained! Just plug and play. 📚</li>
</ul>
<h2>Sneak Peek 🕵️</h2>
<p>Here's a byte-sized teaser of bytesizer magic:</p>
<div class="highlight highlight-source-go notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="// Byte calculating wizardry
size := bytesizer.Calc([]byte("Hello Go"))
// Convert wit to readable charm
fmt.Println(size.String()) // "Hello Go" in bytes!
// Transform with convenience
kilobytes := size.KB()"><pre><span class="pl-c">// Byte calculating wizardry</span>
<span class="pl-s1">size</span> <span class="pl-c1">:=</span> <span class="pl-s1">bytesizer</span>.<span class="pl-c1">Calc</span>([]<span class="pl-smi">byte</span>(<span class="pl-s">"Hello Go"</span>))
<span class="pl-c">// Convert wit to readable charm</span>
<span class="pl-s1">fmt</span>.<span class="pl-c1">Println</span>(<span class="pl-s1">size</span>.<span class="pl-c1">String</span>()) <span class="pl-c">// "Hello Go" in bytes!</span>
<span class="pl-c">// Transform with convenience</span>
<span class="pl-s1">kilobytes</span> <span class="pl-c1">:=</span> <span class="pl-s1">size</span>.<span class="pl-c1">KB</span>()</pre></div>
<p>Embrace <code>bytesizer</code> for your Go projects and keep byte boredom at bay! Happy coding! 🎉</p>iamlongalong