jsonresume/themes/stackoverflow/stackoverflow-assets.go

273 lines
28 KiB
Go
Raw Normal View History

2021-01-31 16:19:34 +01:00
// Code generated by go-bindata. (@generated) DO NOT EDIT.
//Package stackoverflow generated by go-bindata.// sources:
2018-05-10 23:46:04 +02:00
// themes/stackoverflow/resume.template
// themes/stackoverflow/style.css
package stackoverflow
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
func bindataRead(data []byte, name string) ([]byte, error) {
gz, err := gzip.NewReader(bytes.NewBuffer(data))
if err != nil {
2021-01-31 16:19:34 +01:00
return nil, fmt.Errorf("read %q: %v", name, err)
2018-05-10 23:46:04 +02:00
}
var buf bytes.Buffer
_, err = io.Copy(&buf, gz)
clErr := gz.Close()
if err != nil {
2021-01-31 16:19:34 +01:00
return nil, fmt.Errorf("read %q: %v", name, err)
2018-05-10 23:46:04 +02:00
}
if clErr != nil {
return nil, err
}
return buf.Bytes(), nil
}
type asset struct {
bytes []byte
info os.FileInfo
}
type bindataFileInfo struct {
name string
size int64
mode os.FileMode
modTime time.Time
}
2021-01-31 16:19:34 +01:00
// Name return file name
2018-05-10 23:46:04 +02:00
func (fi bindataFileInfo) Name() string {
return fi.name
}
2021-01-31 16:19:34 +01:00
// Size return file size
2018-05-10 23:46:04 +02:00
func (fi bindataFileInfo) Size() int64 {
return fi.size
}
2021-01-31 16:19:34 +01:00
// Mode return file mode
2018-05-10 23:46:04 +02:00
func (fi bindataFileInfo) Mode() os.FileMode {
return fi.mode
}
2021-01-31 16:19:34 +01:00
// ModTime return file modify time
2018-05-10 23:46:04 +02:00
func (fi bindataFileInfo) ModTime() time.Time {
return fi.modTime
}
2021-01-31 16:19:34 +01:00
// IsDir return file whether a directory
2018-05-10 23:46:04 +02:00
func (fi bindataFileInfo) IsDir() bool {
2021-01-31 16:19:34 +01:00
return fi.mode&os.ModeDir != 0
2018-05-10 23:46:04 +02:00
}
2021-01-31 16:19:34 +01:00
// Sys return file is sys mode
2018-05-10 23:46:04 +02:00
func (fi bindataFileInfo) Sys() interface{} {
return nil
}
2021-02-01 22:16:53 +01:00
var _themesStackoverflowResumeTemplate = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xe4\x5b\xdd\x73\xdb\x36\x12\x7f\x96\xff\x0a\x1c\xdb\x69\xda\x99\x48\xb2\x9d\xbb\x4e\x9a\x52\x9a\x49\xd3\x5c\xe3\xd4\x49\x5d\xa7\x69\x27\x4f\x37\x30\xb9\x92\x10\x83\x1f\x01\x20\xc9\xaa\x46\xff\xfb\x0d\xf1\x45\x90\x04\x25\x4a\x96\x7d\x0f\xf7\x92\x58\xd8\x4f\x00\x8b\xfd\xed\x42\x50\xf8\x8f\x38\x8b\xc4\x2a\x07\x34\x13\x09\x1d\x9f\x84\xc5\x7f\x88\xe2\x74\x3a\x0a\xd6\xeb\xc1\x25\x4e\xa7\x73\x3c\x85\xcd\x26\x18\x9f\xf4\xc2\x19\xe0\x78\x7c\xd2\xeb\x85\x09\x08\x8c\xa2\x19\x66\x1c\xc4\x28\x98\x8b\x49\xff\x79\x50\x12\x52\x9c\xc0\x28\x58\x10\x58\xe6\x19\x13\x01\x8a\xb2\x54\x40\x2a\x46\xc1\x92\xc4\x62\x36\x8a\x61\x41\x22\xe8\xcb\x0f\x4f\x11\x49\x89\x20\x98\xf6\x79\x84\x29\x8c\xce\x06\xa7\x4f\xd1\x9c\x03\x93\x9f\xf1\x0d\x85\x51\x9a\x05\x68\x28\x95\x0b\x22\x28\x8c\xaf\x81\xcf\x13\x40\xd9\x04\xad\xd7\x83\x9f\x30\x27\xd1\xe0\x3d\x4e\x60\xb3\x09\x87\x8a\xa1\x60\xa5\x24\xbd\x45\x0c\xe8\x28\xe0\x62\x45\x81\xcf\x00\x44\x80\x66\x0c\x26\xa3\x60\x26\x44\xce\x5f\x0c\x87\x73\x0e\x83\x49\x96\x0a\xbc\x04\x9e\x25\x30\x88\xb2\x64\xc8\x80\x02\xe6\xc0\x87\x8b\x7f\x0d\x4e\x07\x67\xe7\xc3\x88\xf3\x21\xa6\x74\x10\x71\x1e\x20\x92\x0a\x98\x32\x22\x56\xa3\x80\xcf\xf0\xb3\xe7\xff\xec\xff\x72\x3a\xb9\xf8\xeb\x15\x7f\xf5\xf7\xdb\x8b\x77\x2f\xff\x7c\xff\xfb\xd5\xe4\xf3\x9b\xd3\xe7\xd1\xea\x13\xfe\x28\xde\x2d\x3f\xbf\x5d\x7e\x21\xd7\xbf\xde\xdd\xbd\x1e\xb2\xbb\x1f\xbe\xff\xc8\xb2\xcf\x67\x3f\x89\x8b\xdf\xbf\x7f\x77\xf9\x76\x3e\x03\xfc\xdb\x0f\x01\x8a\x58\xc6\x79\xc6\xc8\x94\xa4\xa3\x00\xa7\x59\xba\x4a\xb2\x39\x57\xab\x29\x7d\x2f\xfe\x5a\xaf\x23\xce\x37\x9b\x62\x6c\xa8\x07\x4f\x7a\xe1\x50\xef\x47\x78\x93\xc5\xab\x62\xa4\x17\xc6\x64\x81\x48\x3c\x0a\x98\x5c\x24\xa9\x45\x6d\x1b\x30\x39\xae\xfe\x0c\x50\x44\x31\xe7\xa3\x20\xa2\x80\x99\xe2\xea\xad\xd7\x64\x82\xf4\x82\x5e\x24\x78\x0a\xa8\x2f\x2d\xf6\x7a\x21\x49\xa6\x46\x22\x27\x91\x98\x33\x08\x10\x67\x91\x0c\x11\x47\x60\xb3\x09\x10\xa6\xc2\x19\x56\x1b\xa3\xf7\x4f\xbb\xa7\x15\x25\x24\x8e\xa9\xf6\xb0\xf0\xf1\xcc\x10\x8a\xe8\x09\xc6\x8d\xbd\x9d\x9d\x59\xd6\x73\xc3\x4a\xf1\x0d\x50\x87\xf7\xb2\xf8\x2c\x99\xcf\xb5\xc1\x61\x4c\x16\x66\x7a\x40\xb9\x33\x27\x4b\x78\x14\xdb\x7d\x04\x69\xbc\xd9\x9c\x34\x56\xfa\x32\x8b\xb0\x20\x59\x3a\x78\x45\xc4\xca\xf8\xc6\x73\x9c\x5a\x3b\x9a\xc1\xac\x94\x57\xf8\x65\x1c\x33\xd0\x11\x52\x57\x80\x15\xcd\x75\xb5\x21\xf6\x34\x1c\x16\x22\xd6\x84\x71\xb7\xdd\xe2\x55\xc6\x05\xa6\xaf\xb2\x18\xbc\x46\x73\x4b\xf6\xd9\x75\x85\xf7\x37\xed\xac\x54\xd5\x68\x44\xc4\xca\x67\x4e\x09\xec\x6f\xe8\x1a\xa6\x24\x4b\xbd\xa6\x98\x24\xf9\x8c\x19\xa1\xfd\xa7\x95\xcd\x53\xc1\x56\xad\x4b\x1a\x95\x74\xef\x24\x5d\xf1\x2d\xc6\x5d\x52\x8d\x62\x92\x47\x91\xaf\x71\x24\x7c\x11\xf7\xf1\xfa\xd2\x3a\xe7\x1c\xe6\x25\xdc\x70\x22\xec\x69\xae\x3a\x3e\xc1\x1c\x4d\x70\x1f\xee\x04\xb0\x14\xd3\x7e\x91\x9b\xfb\x98\x8a\x60\x5c\x71\xb3\x17\x62\x24\x30\x9b\x16\x88\xf2\x9f\x1b\x8a\xd3\x5b\x93\xb0\xed\x64\xa5\x75\x67\xf2\xf2\x73\x38\xc4\xe6\x74\x96\x27\x6e\xdb\x8a\xbf\x4e\x30\xa1\xbe\x59\x40\x41\x68\x9b\x03\x93\x73\x48\x17\x40\xb3\x1c\x3c\xae\x2b\x57\x0b\x0d\x22\x7b\x61\x3d\xd4\xb6\x1c\x9f\xf5\xc8\xde\x5e\x5f\xcd\xb2\x14\x7c\x5e\xe7\x05\x61\xeb\xca\x27\xd9\x0d\xa1\xd0\xb2\xe4\xca\x6f\x01\xb4\x74\x5a\x9b\x72\x9c\xd6\x23\x5d\x9c\xd6\x94\x46\xa2\xbb\x62\xd9\x84\x50\xe0\xf5\x60\xcb\xf5\x78\x19\x6d\x0c\xa7\x53\x68\x11\xab\xcc\x9c\x08\x48\xec\xc4\x95\xad\xf7\x20\x96\x19\xbb\x35\xdc\x15\xf6\xa2\xac\x50\x09\x5e\x13\xeb\x8b\x75\x53\x2c\xd6\x7a\x2d\x32\x9a\x2d\x81\x39\xca\x8a\x4a\xa3\xfc\xc0\xb3\x88\x60\x5a\x5f\x4a\xed\x80\x73\x40\x6a\xfa\xe7\xac\x8c\xad\xed\xc1\x5e\x86\xf9\x47\x0e\xcc\x80\x10\x2e\xdd\xae\x1b\x2e\x90\xad\x66\xb5\x2e\x5d\x93\xa8\x84\x59\x65\x37\xeb\xc4\x9d\x3b\xdd\x20\xa8\xba\x04\x98\x0a\x02\x37\x06\x3e\xcc\x93\x04\x33\x9d\xbc\x43\x0e\x51\x91\xb9\xcc\xfa\x98\x8f\x09\x26\x69\x9f\x2b\x4e\xbd\x60\x86\x75\x5c\xc6\x40\x19\x9b\x56\xa9\xe3\x4f\x38\x74\x25\xaa\x9f\x2a\xbe\x2a\xef\x3e\xdc\x12\x4a\xf9\x2e\xb7\xd8\x94\xa4\x67\xc6\x23\x33\x45\xe5\x90\x2d\x0b\x9e\x68\xf6\xbe\x2c\x45\x9f\x8c\x75\x0d\x6d\x2d\xb8\xe5\x81\xab\xc2\x5a\x2d\x8e\x04\x97\xcc\x8d\x03\xe1\x7a\x
2018-05-10 23:46:04 +02:00
func themesStackoverflowResumeTemplateBytes() ([]byte, error) {
return bindataRead(
_themesStackoverflowResumeTemplate,
"themes/stackoverflow/resume.template",
)
}
func themesStackoverflowResumeTemplate() (*asset, error) {
bytes, err := themesStackoverflowResumeTemplateBytes()
if err != nil {
return nil, err
}
2021-02-01 22:16:53 +01:00
info := bindataFileInfo{name: "themes/stackoverflow/resume.template", size: 14173, mode: os.FileMode(420), modTime: time.Unix(1612214070, 0)}
2018-05-10 23:46:04 +02:00
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _themesStackoverflowStyleCss = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x3a\x4d\x73\xdb\x36\x9b\xe7\xe2\x57\x60\x9d\xd9\x49\x9b\x05\x69\x52\x16\x65\x4b\x9e\xc9\x34\xc9\xa4\xed\x21\x69\x3b\x9b\x1c\x7b\x01\x09\x50\x42\x05\x12\x0c\x00\xda\x56\xb6\xde\xdf\xfe\x0e\x48\x02\x24\x40\xca\x4e\xde\xc3\xeb\x4c\x1b\x0b\x78\xf0\x7c\x7f\x2b\x97\xaf\xbe\xe3\x07\xbc\x82\x3f\x48\xaa\xa8\x86\xa5\x14\x95\xf9\x74\xd0\xba\xd9\x5d\x5e\x56\xf4\x44\xe5\x3d\xcd\xe3\x42\x54\x97\x54\xb2\xe2\x52\x0b\xc1\xd5\x65\xa1\xd4\x65\xf7\xe0\x12\x7c\x07\x99\x4b\x00\x0e\xba\xe2\x08\xe4\x82\x9c\x10\x20\xec\x0e\x01\xd5\xe0\x1a\x01\xdc\x34\x9c\x6a\x04\x44\xfe\x37\x2d\x34\x02\xac\x94\xb8\xa2\x08\x1c\x52\x04\x0e\x2b\x04\x0e\x57\x08\x1c\xd6\x08\x1c\x32\x04\x0e\x1b\x04\x1a\x04\x72\x2e\x8a\xe3\x97\x56\x68\x8a\x40\x23\x29\x02\x18\x01\x9c\xe7\x12\x01\x5c\x48\x51\x9f\x2a\x04\x30\x21\x92\x2a\x85\x40\xce\xf6\x08\x14\xcc\x80\x16\x82\x50\x04\x08\xe5\x08\x90\xb2\x46\x80\x56\x08\xb0\x6a\x8f\x00\xab\x15\x02\xc7\x9c\x20\xf0\x05\x01\x85\x80\xc2\x55\x83\x80\xaa\x30\xe7\x08\x28\x2d\xd9\x91\x76\x7f\x8b\x7a\x8f\x80\x6a\x73\xf3\xbf\x06\x01\xad\x11\xb8\xc3\x12\x81\x1c\x81\x16\x01\x86\x40\x41\x6b\x4d\x25\x02\xc4\x90\xd0\x08\x10\x82\x80\xe0\x08\xb4\x1c\x01\xce\x10\x28\x19\xe5\x44\x19\x69\x4b\x21\x2b\x04\x38\xce\x0d\x37\x9c\xee\x69\x4d\x10\xd0\x38\xe7\x86\x4f\xdc\x68\x26\x6a\x04\x74\xaf\x2c\x5d\x0a\xa1\x11\xd0\x07\x8a\x0d\x90\x34\xbf\x22\xa0\x09\x02\x58\x6a\x56\x98\x27\x58\x31\xd2\xbd\xac\xef\xb0\x32\x32\x6a\xcc\xb8\x32\x22\xe6\x94\x18\xba\xfb\xd6\xe8\xa9\x64\x7b\x87\xdc\x20\x35\xbc\x1a\xac\xdd\xdf\x7b\x29\x8c\x54\x15\xad\x5b\x04\x6a\x7c\x87\x80\x68\x75\xd3\x6a\x04\x64\x9b\x9f\x10\x50\xb4\xe8\x5f\xaa\xb6\xaa\xb0\x34\x8c\x31\x63\xa8\x0a\xcb\x23\x02\xb8\x25\x4c\x20\x70\xc7\x08\x15\xf0\xff\x00\x84\x10\x56\x58\xee\x59\xbd\x83\xc9\x6d\xf7\xb1\xc1\x84\xb0\x7a\xef\x3e\xe7\x42\x12\x2a\xdd\xc7\x52\xd4\x3a\x52\xec\x2b\xdd\xc1\x34\x49\xfe\xbb\x3f\xbc\xa3\x46\x42\xcc\x23\xcc\xd9\xbe\xde\xc1\x1c\x2b\xca\x59\x4d\x6f\xc1\x23\x98\x49\xef\xa4\xf6\xc4\xb4\xa2\x3f\x2f\xee\x20\xe0\xc0\x3d\x61\xaa\xe1\xf8\xb4\x83\x9d\xb7\x75\x04\x8d\x39\x86\x5b\xc3\x44\x74\xa0\x6c\x7f\xd0\x3b\x98\x76\xb7\xbd\xa1\xdd\xbd\xd2\x91\xd2\x27\x4e\x77\xb0\x16\x03\xc3\x53\xbf\xfd\x32\x00\x76\x1f\xd5\x22\xd0\x2e\xa7\xa5\x30\xbc\x4f\x8e\x70\xd9\x49\xf1\xc5\xdd\x7d\xe9\x8f\x06\x6c\x85\xa8\x35\xad\xf5\x04\x5d\xe7\x53\xc3\x6d\xaf\xf1\xa8\x10\x9c\xe3\x46\xd1\x1d\xb4\xbf\x4d\x0d\x12\xa9\x06\x17\xd6\x4e\x8f\x00\x80\x59\x3a\x01\xaf\x7e\x78\xf7\xc7\xc7\x8f\x7f\xfc\xfe\x69\x96\x01\x2e\xc1\x10\xe0\x26\xd8\x07\xaa\x9d\x61\x4b\x5c\x31\x7e\xda\xc1\x8b\xdf\x28\xbf\xa3\xc6\xa6\xf0\x77\xda\xd2\x0b\x04\xdd\x01\x82\x6f\x24\xc3\x1c\xc1\x8b\x0f\x6d\xc1\x08\x86\xbf\x4a\x5c\x13\x03\xa2\x70\xad\x22\x45\x25\x2b\xe7\xae\x72\xd5\x3c\xdc\x0e\xa2\x73\x21\x77\xf0\xc5\x3a\x59\xdf\xac\xa7\x80\xf7\x83\x95\xd6\xc9\xe0\x69\x9c\x6a\x1d\xc8\x39\x37\x69\xbc\xde\xa4\xd9\xd5\xcd\x7a\xd3\x5f\x6a\xfa\xa0\xad\x13\x72\x5a\xea\xfe\x34\xba\xa7\xf9\x91\xe9\xa8\xbb\x35\x0c\x45\x98\xfc\xdd\x2a\x6d\x5d\xf8\x11\x80\xe6\x8c\x3b\x8d\x01\x12\xe5\x42\x6b\x51\x19\x9a\x57\xb4\xea\x3d\xdb\x99\xb3\x97\x29\x49\xb6\x59\x59\x4e\x38\x21\xb4\x10\x12\x1b\x6f\x9d\x98\x1a\xef\x0e\xe2\x6e\xe2\x0a\xc3\xdb\x62\x93\xe1\xec\xcc\xdb\xb6\x26\x54\xba\x80\x72\xde\x3b\x30\xa6\x45\xb3\x83\xa9\x1c\x98\xe2\x6c\xe6\xdb\x91\x3e\x35\x74\x07\xd5\x97\x16\x4b\x7a\x1b\x5e\x36\x42\xb1\x9e\x8c\x68\xb5\x09\x51\x4f\x6a\xa3\xc5\xa9\xcc\xf1\x81\xed\x0f\xdc\x68\x5f\xbd\xe6\xec\x75\xe3\xb3\x62\x75\x94\xc4\xd9\x00\x7f\x48\xa7\xfe\xd5\x7b\xc3\xca\xf2\x7a\x58\xcd\x2f\xd3\x78\x73\xed\xee\xaf\x96\xee\x57\xee\x9e\x56\x81\x16\xaf\x33\xf3\x27\x08\xd0\x65\x16\xd3\x01\x47\x5f\x30\xa6\x74\xac\x27\x5e\x27\x2e\xb4\x60\x85\x59\xdd\x85\x2d\x66\x35\x95\xd0\x44\xd0\x0b\x49\x55\x5b\x59\xec\x2e\x6d\xf6\x86\x08\xcd\xe3\x44\x36\xc8\xe8\x1d\x95\x27\x68\xf3\xd8\xbd\xc4\x4d\x33\xe0\x8c\xfd\xe4\x16\xb2\x6c\x91\x58\xa8\x98\x8b\x02\xcf\xe1\x65\xcf\x7f\x6f\x83\xa9\x7a\x36\xc9\x86\x5c\x6f\x16\x82\xce\x8a\xfa\xa2\x13\xb1\xd0\x0b\x0e\x16\x67\x96\xfa\x8b\x46\x8a\x92\x71\xaa\x60\xcc\xb4\x33\xc1\xb4\x6e\x18\xa0\x3e\x83\xbf\x76\xc0\x68\x3c\x1a\x88
func themesStackoverflowStyleCssBytes() ([]byte, error) {
return bindataRead(
_themesStackoverflowStyleCss,
"themes/stackoverflow/style.css",
)
}
func themesStackoverflowStyleCss() (*asset, error) {
bytes, err := themesStackoverflowStyleCssBytes()
if err != nil {
return nil, err
}
2021-01-31 16:19:34 +01:00
info := bindataFileInfo{name: "themes/stackoverflow/style.css", size: 10452, mode: os.FileMode(493), modTime: time.Unix(1596890556, 0)}
2018-05-10 23:46:04 +02:00
a := &asset{bytes: bytes, info: info}
return a, nil
}
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func Asset(name string) ([]byte, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err)
}
return a.bytes, nil
}
return nil, fmt.Errorf("Asset %s not found", name)
}
// MustAsset is like Asset but panics when Asset would return an error.
// It simplifies safe initialization of global variables.
func MustAsset(name string) []byte {
a, err := Asset(name)
if err != nil {
panic("asset: Asset(" + name + "): " + err.Error())
}
return a
}
// AssetInfo loads and returns the asset info for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
func AssetInfo(name string) (os.FileInfo, error) {
cannonicalName := strings.Replace(name, "\\", "/", -1)
if f, ok := _bindata[cannonicalName]; ok {
a, err := f()
if err != nil {
return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err)
}
return a.info, nil
}
return nil, fmt.Errorf("AssetInfo %s not found", name)
}
// AssetNames returns the names of the assets.
func AssetNames() []string {
names := make([]string, 0, len(_bindata))
for name := range _bindata {
names = append(names, name)
}
return names
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"themes/stackoverflow/resume.template": themesStackoverflowResumeTemplate,
2021-01-31 16:19:34 +01:00
"themes/stackoverflow/style.css": themesStackoverflowStyleCss,
2018-05-10 23:46:04 +02:00
}
// AssetDir returns the file names below a certain
// directory embedded in the file by go-bindata.
// For example if you run go-bindata on data/... and data contains the
// following hierarchy:
// data/
// foo.txt
// img/
// a.png
// b.png
// then AssetDir("data") would return []string{"foo.txt", "img"}
// AssetDir("data/img") would return []string{"a.png", "b.png"}
// AssetDir("foo.txt") and AssetDir("notexist") would return an error
// AssetDir("") will return []string{"data"}.
func AssetDir(name string) ([]string, error) {
node := _bintree
if len(name) != 0 {
cannonicalName := strings.Replace(name, "\\", "/", -1)
pathList := strings.Split(cannonicalName, "/")
for _, p := range pathList {
node = node.Children[p]
if node == nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
}
}
if node.Func != nil {
return nil, fmt.Errorf("Asset %s not found", name)
}
rv := make([]string, 0, len(node.Children))
for childName := range node.Children {
rv = append(rv, childName)
}
return rv, nil
}
type bintree struct {
Func func() (*asset, error)
Children map[string]*bintree
}
2021-01-31 16:19:34 +01:00
2018-05-10 23:46:04 +02:00
var _bintree = &bintree{nil, map[string]*bintree{
"themes": &bintree{nil, map[string]*bintree{
"stackoverflow": &bintree{nil, map[string]*bintree{
"resume.template": &bintree{themesStackoverflowResumeTemplate, map[string]*bintree{}},
2021-01-31 16:19:34 +01:00
"style.css": &bintree{themesStackoverflowStyleCss, map[string]*bintree{}},
2018-05-10 23:46:04 +02:00
}},
}},
}}
// RestoreAsset restores an asset under the given directory
func RestoreAsset(dir, name string) error {
data, err := Asset(name)
if err != nil {
return err
}
info, err := AssetInfo(name)
if err != nil {
return err
}
err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755))
if err != nil {
return err
}
err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode())
if err != nil {
return err
}
err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime())
if err != nil {
return err
}
return nil
}
// RestoreAssets restores an asset under the given directory recursively
func RestoreAssets(dir, name string) error {
children, err := AssetDir(name)
// File
if err != nil {
return RestoreAsset(dir, name)
}
// Dir
for _, child := range children {
err = RestoreAssets(dir, filepath.Join(name, child))
if err != nil {
return err
}
}
return nil
}
func _filePath(dir, name string) string {
cannonicalName := strings.Replace(name, "\\", "/", -1)
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
}