<story><title>Go command support for embedded static assets (files)</title><url>https://go.googlesource.com/proposal/+/master/design/draft-embed.md</url></story><parent_chain></parent_chain><comment><author>breakingcups</author><text>Again, more magic comments.&lt;p&gt;The proposed feature is great, but the unwillingness of the Go team to use a separate, clearly defined project file or at the very least a separate syntax in your code file leads them to stuff every additional feature into comments, a space shared by human notetaking.&lt;p&gt;Let&amp;#x27;s have a look:
* Build constraints (&amp;#x2F;&amp;#x2F; +build linux)
* Code generation (&amp;#x2F;&amp;#x2F;go:generate &amp;lt;command&amp;gt; &amp;lt;arguments&amp;gt;)
* Cgo, you can even stuff entire C programs in the comments (&amp;#x2F;&amp;#x2F; #include &amp;lt;stdio.h&amp;gt;)
* Cgo flags (&amp;#x2F;&amp;#x2F; #cgo CFLAGS: -DPNG_DEBUG=1)
* and now this, file embedding (&amp;#x2F;&amp;#x2F;go:embed html&amp;#x2F;index.html)&lt;p&gt;Most novices would assume the commented out code does nothing, and rightly so in my opinion.
Half of these features aren&amp;#x27;t even code-file specific but project-wide, making deciding which file to put them in hard and looking them up even harder.</text></comment>
<story><title>Go command support for embedded static assets (files)</title><url>https://go.googlesource.com/proposal/+/master/design/draft-embed.md</url></story><parent_chain></parent_chain><comment><author>leetrout</author><text>That’s showing some real support to the community IMO.&lt;p&gt;There are plenty of purists that argue both for and against the concept but one cannot deny it fits very well in the sales pitch for Go. You can have a simple tool chain to ship a binary for any number of systems and that support for embedded assets would be a first class citizen.&lt;p&gt;I would also love to see them address more robust plugin options or officially adopt &amp;#x2F; endorse the pattern HashiCorp uses as they’re doing here with the bindata prior art.</text></comment>