Package bindata is a helper module that allows to use in-memory static and template files for Macaron Instances.
go get github.com/go-macaron/bindata
Import the packages and use them like the example below.
import (
"path/to/bindata/public"
"path/to/bindata/templates"
"github.com/go-macaron/bindata"
)
m.Use(macaron.Static("public",
macaron.StaticOptions{
FileSystem: bindata.Static(bindata.Options{
Asset: public.Asset,
AssetDir: public.AssetDir,
AssetNames: public.AssetNames,
Prefix: "",
}),
},
))
m.Use(macaron.Renderer(macaron.RenderOptions{
TemplateFileSystem: bindata.Templates(bindata.Options{
Asset: templates.Asset,
AssetDir: templates.AssetDir,
AssetNames: templates.AssetNames,
Prefix: "",
}),
}))