Include ricebox .go to fix build
parent
7ea083bc6d
commit
05d1455145
@ -0,0 +1,41 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/GeertJohan/go.rice/embedded"
|
||||
"time"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
// define files
|
||||
file2 := &embedded.EmbeddedFile{
|
||||
Filename: "index.tmpl",
|
||||
FileModTime: time.Unix(1576433620, 0),
|
||||
Content: string("<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\" />\n <title>What is My IP?</title>\n <style type=\"text/css\">\n .ip {\n text-align: center;\n }\n </style>\n </head>\n <body>\n <code class=\"ip\"><pre>{{.IP}}</pre></code>\n </body>\n</html>\n"),
|
||||
}
|
||||
|
||||
// define dirs
|
||||
dir1 := &embedded.EmbeddedDir{
|
||||
Filename: "",
|
||||
DirModTime: time.Unix(1576433633, 0),
|
||||
ChildFiles: []*embedded.EmbeddedFile{
|
||||
file2, // "index.tmpl"
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
// link ChildDirs
|
||||
dir1.ChildDirs = []*embedded.EmbeddedDir{}
|
||||
|
||||
// register embeddedBox
|
||||
embedded.RegisterEmbeddedBox(`templates`, &embedded.EmbeddedBox{
|
||||
Name: `templates`,
|
||||
Time: time.Unix(1576433633, 0),
|
||||
Dirs: map[string]*embedded.EmbeddedDir{
|
||||
"": dir1,
|
||||
},
|
||||
Files: map[string]*embedded.EmbeddedFile{
|
||||
"index.tmpl": file2,
|
||||
},
|
||||
})
|
||||
}
|
Loading…
Reference in New Issue