mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-24 02:32:17 +08:00
fix: add asset file
This commit is contained in:
parent
c5d5f56cd8
commit
412571aa3c
34
examples/assets-in-binary/assets.go
Normal file
34
examples/assets-in-binary/assets.go
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/jessevdk/go-assets"
|
||||||
|
)
|
||||||
|
|
||||||
|
var _Assetsbfa8d115ce0617d89507412d5393a462f8e9b003 = "<!doctype html>\n<body>\n <p>Can you see this? → {{.Bar}}</p>\n</body>\n"
|
||||||
|
var _Assets3737a75b5254ed1f6d588b40a3449721f9ea86c2 = "<!doctype html>\n<body>\n <p>Hello, {{.Foo}}</p>\n</body>\n"
|
||||||
|
|
||||||
|
// Assets returns go-assets FileSystem
|
||||||
|
var Assets = assets.NewFileSystem(map[string][]string{"/": []string{"html"}, "/html": []string{"bar.tmpl", "index.tmpl"}}, map[string]*assets.File{
|
||||||
|
"/": &assets.File{
|
||||||
|
Path: "/",
|
||||||
|
FileMode: 0x800001ed,
|
||||||
|
Mtime: time.Unix(1524365491, 1524365491290127693),
|
||||||
|
Data: nil,
|
||||||
|
}, "/html": &assets.File{
|
||||||
|
Path: "/html",
|
||||||
|
FileMode: 0x800001ed,
|
||||||
|
Mtime: time.Unix(1524365491, 1524365491289799093),
|
||||||
|
Data: nil,
|
||||||
|
}, "/html/bar.tmpl": &assets.File{
|
||||||
|
Path: "/html/bar.tmpl",
|
||||||
|
FileMode: 0x1a4,
|
||||||
|
Mtime: time.Unix(1524365491, 1524365491289611557),
|
||||||
|
Data: []byte(_Assetsbfa8d115ce0617d89507412d5393a462f8e9b003),
|
||||||
|
}, "/html/index.tmpl": &assets.File{
|
||||||
|
Path: "/html/index.tmpl",
|
||||||
|
FileMode: 0x1a4,
|
||||||
|
Mtime: time.Unix(1524365491, 1524365491289995821),
|
||||||
|
Data: []byte(_Assets3737a75b5254ed1f6d588b40a3449721f9ea86c2),
|
||||||
|
}}, "")
|
Loading…
x
Reference in New Issue
Block a user