File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,16 +4,20 @@ package cert
44// This file provides the web app and registers itself via init().
55
66import (
7+ "embed"
78 "html/template"
89 "net/http"
910 "strings"
1011
1112 "github.com/linuxexam/goweb/router"
1213)
1314
15+ //embed resource files
16+ //go:embed *.html
17+ var webUI embed.FS
18+
1419var (
15- tpls = template .Must (template .ParseFiles (
16- "cert/cert.html" ))
20+ tpls = template .Must (template .ParseFS (webUI , "*.html" ))
1721)
1822
1923type PageCert struct {
Original file line number Diff line number Diff line change 11package router
22
33import (
4+ "embed"
45 "html/template"
56 "net/http"
67 "sync"
78)
89
10+ //go:embed router.html
11+ var webUI embed.FS
12+
913var (
10- tpls = template .Must (template .ParseFiles (
11- "router/router.html" ))
14+ tpls = template .Must (template .ParseFS (webUI , "*.html" ))
1215)
1316var (
1417 appsMu sync.RWMutex
You can’t perform that action at this time.
0 commit comments