Friday, October 26, 2012

nrsc - Take 2

After getting some good comments on nrsc and reading more. I re-wrote the implementation to append a zip file to the executable and serve resources from there (idea from Carlos Castillo).

The order you do the packing has change, you first "go build" and then run the nrsc script.

Here the nrsc script that packs the zip into the executable. The nrsc API didn't change that much.

Tuesday, October 23, 2012

nrsc - Resource Compiler

IMO one of the nicest things in Go is the "single executable deployment". However this breaks down when you have some templates, css files, ...

For this I created nrsc, it's a resource compiler that will compile your resources to a local nrsc package which you can include in your project. Building your project after running nrsc will embed all the resource in the executable.

To install nrsc just run go get bitbucket.org/tebeka/nrsc

Here's an example on how to use nrsc in your code:

/* MIKI: Analytics */