add makefile
This commit is contained in:
parent
59230b7ad5
commit
6708d9ff33
3 changed files with 34 additions and 1 deletions
6
main.go
6
main.go
|
|
@ -12,8 +12,12 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
_ "embed"
|
||||
)
|
||||
|
||||
//go:embed templates/dir.html
|
||||
var dirTemplateSrc string
|
||||
|
||||
type (
|
||||
Directory struct {
|
||||
Name string
|
||||
|
|
@ -89,7 +93,7 @@ func main() {
|
|||
".DS_Store",
|
||||
}
|
||||
|
||||
dirTemplate, err := template.ParseGlob("./templates/dir.html")
|
||||
dirTemplate, err := template.New("dir").Parse(dirTemplateSrc)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "fatal: failed to parse directory template: %v\n", err)
|
||||
os.Exit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue