TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Static files in Go

90 点作者 bouk将近 9 年前

6 条评论

TazeTSchnitzel将近 9 年前
It&#x27;s quite a common use-case to embed binary data into binaries, so I wonder why more languages don&#x27;t directly support it with some sort of directive in source code.<p>Interestingly the X Window System took the opposite approach for its images. Rather than making C accommodate their images, they made their images accommodate C! <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;X_BitMap" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;X_BitMap</a> and <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;X_PixMap" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;X_PixMap</a> are both image formats that consist of C code.
评论 #12259679 未加载
评论 #12260417 未加载
评论 #12260586 未加载
vbernat将近 9 年前
The article doesn&#x27;t explain why the author didn&#x27;t contribute to one of the existing solutions to add the only feature they were missing.
评论 #12260210 未加载
评论 #12262202 未加载
nathan7将近 9 年前
Awesome! The one thing that turns me off a little is `ModTime`. I generally avoid incorporating modification times into my build (generally I force them to 1970), but a hash for the ETag would be very welcome.
评论 #12258958 未加载
评论 #12262620 未加载
cyphar将近 9 年前
A friend of mine implemented something similar[1], but as a pre-processor for the source code. I&#x27;ll be honest, it&#x27;s very scary code but I thought it was interesting. :P<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;sysr-q&#x2F;assets" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sysr-q&#x2F;assets</a>
ahacker15将近 9 年前
The better tool I know for this use case is fileb0x[1]. It work for all my needs, has some features that the alternatives lack.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;UnnoTed&#x2F;fileb0x" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;UnnoTed&#x2F;fileb0x</a>
leetrout将近 9 年前
I&#x27;m not sure I understand how using ego ensures that it is fast. Could someone ELI5 please?
评论 #12258857 未加载
评论 #12258787 未加载
评论 #12258974 未加载