package app import ( "os" "path/filepath" "runtime" ) func projectRoot() string { _, file, _, ok := runtime.Caller(0) if !ok { return "." } return filepath.Clean(filepath.Join(filepath.Dir(file), "..", "..")) } func assetRoot() string { if _, err := os.Stat(filepath.Join("web", "templates")); err == nil { return "web" } return filepath.Join(projectRoot(), "web") }