diff options
Diffstat (limited to 'vendor/github.com/go-macaron/bindata/bindata.go')
-rw-r--r-- | vendor/github.com/go-macaron/bindata/bindata.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/vendor/github.com/go-macaron/bindata/bindata.go b/vendor/github.com/go-macaron/bindata/bindata.go index f20d132436..637489e1cd 100644 --- a/vendor/github.com/go-macaron/bindata/bindata.go +++ b/vendor/github.com/go-macaron/bindata/bindata.go @@ -17,13 +17,16 @@ package bindata import ( + "bytes" + "fmt" + "io" "os" "github.com/elazarl/go-bindata-assetfs" "gopkg.in/macaron.v1" ) -const _VERSION = "0.1.0" +const _VERSION = "0.1.1" func Version() string { return _VERSION @@ -69,6 +72,15 @@ func (templates templateFileSystem) ListFiles() []macaron.TemplateFile { return templates.files } +func (templates templateFileSystem) Get(name string) (io.Reader, error) { + for i := range templates.files { + if templates.files[i].Name()+templates.files[i].Ext() == name { + return bytes.NewReader(templates.files[i].Data()), nil + } + } + return nil, fmt.Errorf("file '%s' not found", name) +} + func (f *templateFile) Name() string { return f.name } |