Setup for being a library

This commit is contained in:
2026-02-26 22:18:08 +02:00
parent be6a0f0790
commit 7d7bf6ae05
3 changed files with 7 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
package main
import (
"embed"
"fmt"
"html/template"
"image/color"
@@ -12,7 +13,7 @@ import (
"strings"
"time"
"test-maze/maze"
maze "tea.chunkbyte.com/kato/go-maze/maze"
)
const (
@@ -41,7 +42,10 @@ type mazeParams struct {
SolveB uint8
}
var pageTmpl = template.Must(template.ParseFiles("templates/index.html"))
//go:embed templates/index.html
var templatesFS embed.FS
var pageTmpl = template.Must(template.ParseFS(templatesFS, "templates/index.html"))
type pageData struct {
mazeParams

2
go.mod
View File

@@ -1,3 +1,3 @@
module test-maze
module tea.chunkbyte.com/kato/go-maze
go 1.25.5