diff options
author | Bwko <bouwko@gmail.com> | 2017-01-25 05:26:31 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-01-25 12:26:31 +0800 |
commit | 8555e888d8690df718b1673b8409a29d05770cf4 (patch) | |
tree | 19b7cb9e6f548b87aef122b66f99e04dcfe36335 /vendor/github.com | |
parent | 8093b3372e812af6a5c3aab32559881011861243 (diff) | |
download | gitea-8555e888d8690df718b1673b8409a29d05770cf4.tar.gz gitea-8555e888d8690df718b1673b8409a29d05770cf4.zip |
Add ETag header to avatars (#721)
Diffstat (limited to 'vendor/github.com')
-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 } |