The PrefixDir function
The iris.PrefixDir
function wraps an existing "fs" file system and returns a new one which open files by prepending the path with the given "prefix".
It is extremely useful when you use a go-bindata
file to embed both view templates and public static files. With PrefixDir
you can select which directory to use to serve static files and which to render views.
Example
Let's build the bindata.go
file which will contain the embedded ./data
directory:
Use the ./data/views
for templates and ./data/public
for file server:
Last updated