Today I released mule. It is intended for use with Google Go. In Go it is a common pattern that your project compiles into a single binary without any external dependencies. But often you need some external resources as images for example. These remain external and may need to be updated separately on any change

So I wrote mule. Using it you can embed your resource into go code. You will need to run mule on that resource file to create a corresponding Go source file. That file exposes a function, which returns the resource as a []byte. mule works by generating a function with the resource being converted into a MIME-encoded string. When calling the function this string is decoded into the resource.

mule works nicely with go generate, so that you can include it very comfortably in your Makefile and it will be run at any change of the resource file.

Take a look at its Github repository for more details and an example.