jsonresume/themes/stackoverflow/stackoverflow-assets.go

273 lines
29 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-03-01 14:45:06 +01:00
var _themesStackoverflowResumeTemplate = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x5b\x5f\x73\xdb\x36\x12\x7f\x96\x3f\x05\x8e\xed\x34\xed\x4c\x24\xd9\xce\x5d\x27\x4d\x28\xcd\xa4\x49\x9a\x38\x75\x52\xd7\x69\xda\xc9\xd3\x0d\x4c\xae\x24\xc4\xe0\x9f\x00\x90\x64\x55\xa3\xef\x7e\x43\x80\x00\x01\x12\x94\x68\x59\xf6\xdd\xdc\x4b\x62\x01\xfb\x0f\xd8\xc5\xfe\x76\x21\x28\xfc\x47\x9c\x45\x62\x95\x03\x9a\x89\x84\x8e\x8f\xc2\xe2\x3f\x44\x71\x3a\x1d\x05\xeb\xf5\xe0\x1c\xa7\xd3\x39\x9e\xc2\x66\x13\x8c\x8f\x7a\xe1\x0c\x70\x3c\x3e\xea\xf5\xc2\x04\x04\x46\xd1\x0c\x33\x0e\x62\x14\xcc\xc5\xa4\xff\x34\xa8\x26\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\x8f\x11\x49\x89\x20\x98\xf6\x79\x84\x29\x8c\x4e\x06\xc7\x8f\xd1\x9c\x03\x93\x9f\xf1\x15\x85\x51\x9a\x05\x68\x28\x85\x0b\x22\x28\x8c\x2f\x81\xcf\x13\x40\xd9\x04\xad\xd7\x83\x9f\x31\x27\xd1\xe0\x03\x4e\x60\xb3\x09\x87\x8a\xa0\x20\xa5\x24\xbd\x46\x0c\xe8\x28\xe0\x62\x45\x81\xcf\x00\x44\x80\x66\x0c\x26\xa3\x60\x26\x44\xce\x9f\x0d\x87\x73\x0e\x83\x49\x96\x0a\xbc\x04\x9e\x25\x30\x88\xb2\x64\xc8\x80\x02\xe6\xc0\x87\x8b\x7f\x0d\x8e\x07\x27\xa7\xc3\x88\xf3\x21\xa6\x74\x10\x71\x1e\x20\x92\x0a\x98\x32\x22\x56\xa3\x80\xcf\xf0\x93\xa7\xff\xec\xbf\x39\x9e\x9c\xfd\xf5\x92\xbf\xfc\xfb\xdd\xd9\xfb\x17\x7f\x7e\xf8\xfd\x62\xf2\xe5\xed\xf1\xd3\x68\xf5\x19\x7f\x12\xef\x97\x5f\xde\x2d\xbf\x92\xcb\x5f\x6f\x6e\x5e\x0f\xd9\xcd\x4f\x3f\x7e\x62\xd9\x97\x93\x9f\xc5\xd9\xef\x3f\xbe\x3f\x7f\x37\x9f\x01\xfe\xed\xa7\x00\x45\x2c\xe3\x3c\x63\x64\x4a\xd2\x51\x80\xd3\x2c\x5d\x25\xd9\x9c\xab\xdd\x94\xb6\x17\x7f\xad\xd7\x11\xe7\x9b\x4d\x31\x36\x2c\x07\x8f\x7a\xe1\xb0\xf4\x47\x78\x95\xc5\xab\x62\xa4\x17\xc6\x64\x81\x48\x3c\x0a\x98\xdc\x24\x29\x45\xb9\x0d\x98\x1c\x57\x7f\x06\x28\xa2\x98\xf3\x51\x10\x51\xc0\x4c\x51\xf5\xd6\x6b\x32\x41\xe5\x86\x9e\x25\x78\x0a\xa8\x2f\x35\xf6\x7a\x21\x49\xa6\x9a\x23\x27\x91\x98\x33\x08\x10\x67\x91\x0c\x11\x8b\x61\xb3\x09\x10\xa6\xc2\x1a\x56\x8e\x29\xfd\x57\x9a\x57\x0a\x4a\x48\x1c\xd3\xd2\xc2\xc2\xc6\x13\x3d\x51\x44\x4f\x30\x6e\xf8\x76\x76\x62\x48\x4f\x35\x29\xc5\x57\x40\x2d\xda\xf3\xe2\xb3\x24\x3e\x2d\x15\x0e\x63\xb2\xd0\xcb\x03\xca\xad\x35\x99\x89\x07\xd1\xdd\x47\x90\xc6\x9b\xcd\x51\x63\xa7\xcf\xb3\x08\x0b\x92\xa5\x83\x97\x44\xac\xb4\x6d\x3c\xc7\xa9\xd1\x53\x12\xe8\x9d\x2a\x64\x15\xec\x9f\x38\xfc\x32\xa7\xf4\x45\x1c\x33\xe0\xdc\xac\xcb\x2f\xbc\xa4\xd2\x34\x8e\x02\xac\xe6\xec\xa5\x34\xd8\x1e\x87\xc3\x82\xc5\x32\x41\x2d\xa7\x5d\xe3\x45\xc6\x05\xa6\x2f\xb3\x18\xbc\x4a\x73\x33\xed\xd3\x6b\x33\xdf\x5e\xb5\xb5\x93\xae\xd2\x88\x88\x95\x4f\x9d\x62\xd8\xa1\xa8\x8f\x9c\xf8\xf1\xab\xfe\x38\xcb\x98\xd8\xb6\xd9\x6d\x26\xb8\x8c\xbb\x4d\x49\xe3\x1d\x96\x5c\xc2\x94\x64\xa9\xd7\x06\x26\xa7\x7c\x56\x68\xa6\xdb\x6f\x79\x36\x4f\x05\x5b\xb5\xba\x3b\xaa\xe6\xbd\x0e\xb0\xd9\xb7\x28\xb7\xa7\x6a\x33\x3a\xf1\x15\x58\x83\x23\x51\x9d\x96\xca\xda\x4f\x97\xe7\xc6\x38\x2b\x11\x2d\xe1\x8a\x13\x61\x32\x91\x6b\xf8\x04\x73\x34\xc1\x7d\xb8\x11\xc0\x52\x4c\xfb\x05\xae\xf4\x31\x15\xc1\xd8\x31\xb3\x17\x62\x24\x30\x9b\x16\x68\xf8\xef\x2b\x8a\xd3\x6b\x0d\x36\x66\xb1\x52\xbb\xb5\x78\xf9\x39\x1c\x62\x9d\x59\xaa\x6c\xb1\x6d\xc7\x5f\x27\x98\x50\xdf\x2a\xa0\x98\x68\x5b\x03\x93\x6b\x48\x17\x40\xb3\x1c\x3c\xa6\x2b\x53\x0b\x09\x22\x7b\x66\x2c\x2c\x75\x59\x36\x97\x23\xdd\xad\xc6\x69\xac\x2d\xbf\x98\x65\x29\xd4\xd3\x96\x6f\x25\x79\x41\xb8\xd5\x1b\x49\x76\x45\x28\xb4\xb8\x41\xad\x45\x00\xad\x16\x22\x55\x3b\x0b\x29\x47\xba\x2c\xa4\x9c\x69\x24\xee\x0b\x96\x4d\x08\x05\x5e\x0f\xc0\xbc\x1c\xaf\x22\x90\xe1\x74\x0a\x2d\x6c\xce\xca\x89\x80\xc4\x2c\x5c\xe9\xfa\x00\x62\x99\xb1\x6b\x4d\xed\x90\x17\x65\x92\x02\xac\x72\xb2\xbe\x59\x57\xc5\x66\xad\xd7\x22\xa3\xd9\x12\x98\x25\xac\xa8\x9c\xaa\x0f\x3c\x8b\x08\xa6\xf5\xad\x2c\x0d\xb0\x0e\x4d\x4d\xfe\x9c\x55\xf1\xb6\xfd\x00\x54\xa1\xff\x89\x03\xd3\xa0\x8a\x2b\xb3\xeb\x8a\x8b\x4c\x5b\xd3\x5a\xe7\xae\x71\x38\xa1\xe7\x78\xb3\x3e\xb9\xd3\xd3\x8d\x09\x55\x67\x01\x53\x41\x60\xc7\xc0\xc7\x79\x92\x60\x56\x82\x4d\xc8\x21\x2a\xb2\x99\xde\x1f\xfd\x31\xc1\x24\xed\x73\x45\x59\x6e\x98\x26\x1d\x57\x31\x50\xc5\xa6\x11\x6a\xd9\x13\x0e\x6d\x0e\xf7\x93\x63\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-03-01 14:45:06 +01:00
info := bindataFileInfo{name: "themes/stackoverflow/resume.template", size: 14397, mode: os.FileMode(420), modTime: time.Unix(1614606251, 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, "/")...)...)
}