<p>Hi, I wrote a new code gen tool for embedding binary assets, called <a href="https://github.com/lmas/yaber">yaber</a>.</p>
<p>It's a yet another tool (heh) that tries to be minimalistic, simple to use and guess sane defaults, aswell as producing gofmt'ed (and go:generate) code and a accompanying test file.</p>
<p>I'm currently trying it in production for a couple of my own projects, but I'm looking for inputs/criticism/testing from others. Is it a worthy competitor to <a href="https://github.com/avelino/awesome-go#resource-embedding">similar tools</a>?</p>
<hr/>**评论:**<br/><br/>bear1728: <pre><p>I like your <code>getPackageName</code> function! It looks simpler than what I hacked together for <a href="https://github.com/tscholl2/embd" rel="nofollow">my own binary embedder</a>. Also great name :)</p></pre>karnd01: <pre><p>Nice Work! Looks like a great start.</p>
<p>just some things that may be a nice-to-have that I tried to address in <a href="https://github.com/go-playground/statics" rel="nofollow">statics</a>:</p>
<ul>
<li>Maybe an option to decompress files on startup or store decompressed version after first decompression to avoid doing it multiple times ( would speed up serving of files from http.FileServer )</li>
<li>Support Symlinks. It's not fun but whenever I embed it's mostly my html assets javascript, css and images which a good deal of the time I need symlink folders for images etc. embedded in a CSS library.</li>
<li>Support for generating multiple static files within the same package eg. statically embed html assets and website certificates, where the folders happen to be at the same level in the same package. The reason I would not want to put in the same folder is when adding static files to http.FileServer I can have my sites cert files exposed.</li>
<li>Possibility to embed the generation command right inside the generated file using go:generate for easy of automated builds.</li>
</ul>
<p>Feel free to steal anything from my package that may help and keep up the great work :)</p></pre>kylewolfe: <pre><blockquote>
<p>Maybe an option to decompress files on startup or store decompressed version after first decompression to avoid doing it multiple times ( would speed up serving of files from http.FileServer )</p>
</blockquote>
<p>Given the amount of use cases for embedded assets, and each having it's own best practice for caching of the assets, I'd say it's fine to leave this feature out.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传