mirror of
https://github.com/nxshock/gron.git
synced 2024-11-27 03:41:00 +05:00
22 lines
365 B
Go
22 lines
365 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
_ "embed"
|
||
|
"html/template"
|
||
|
|
||
|
log "github.com/sirupsen/logrus"
|
||
|
)
|
||
|
|
||
|
//go:embed index.htm
|
||
|
var indexTemplateStr string
|
||
|
|
||
|
var indexTemplate *template.Template
|
||
|
|
||
|
func initTemplate() {
|
||
|
var err error
|
||
|
indexTemplate, err = template.New("index").Parse(indexTemplateStr) // TODO: optimize
|
||
|
if err != nil {
|
||
|
log.Fatalln("init template error:", err)
|
||
|
}
|
||
|
}
|