Use vfsgen instead of go-bindata (#7080)

* use vfsgen instead of go-bindata

* fix templates

* fix fmt

* vendor vsfgen
This commit is contained in:
Lunny Xiao authored and Lauris BH committed 2019-06-03 00:43:47 +03:00
1 parent 8eba27c792
commit 83b90e4199
36 files changed
+1224 -612

No files matched your search

+18
View File
@@ -203,3 +203,21 @@ func Mailer() *template.Template {
return templates
}
func Asset(name string) ([]byte, error) {
f, err := Assets.Open("/" + name)
if err != nil {
return nil, err
}
defer f.Close()
return ioutil.ReadAll(f)
}
func AssetNames() []string {
realFS := Assets.(vfsgen۰FS)
var results = make([]string, 0, len(realFS))
for k := range realFS {
results = append(results, k[1:])
}
return results
}