Changed Project structure, added Hot Reload of gohtml files for Develop and embedding of gohtml files for Release
This commit is contained in:
18
internal/view/hotreload.go
Normal file
18
internal/view/hotreload.go
Normal file
@@ -0,0 +1,18 @@
|
||||
//go:build Develop
|
||||
|
||||
package view
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
)
|
||||
|
||||
func GetViewTemplate(view View) (*template.Template, error) {
|
||||
var path string
|
||||
switch view {
|
||||
case Menu:
|
||||
path = "internal/view/Views/menu.gohtml"
|
||||
case Viewer:
|
||||
path = "internal/view/Views/viewer.gohtml"
|
||||
}
|
||||
return template.ParseFiles(path)
|
||||
}
|
||||
Reference in New Issue
Block a user