Fix silliness with template path bullshittery

This commit is contained in:
spsobole 2021-01-18 11:40:03 -07:00
parent a2023cf8f3
commit b3f019793a
4 changed files with 23 additions and 2 deletions

8
go.mod Normal file
View File

@ -0,0 +1,8 @@
module git.thirdmartini.com/pub/snap
go 1.15
require (
git.thirdmartini.com/pub/fancylog v0.0.0-20180118031448-3f3ebedd6016
github.com/gorilla/mux v1.8.0
)

3
go.sum Normal file
View File

@ -0,0 +1,3 @@
git.thirdmartini.com/pub/fancylog v0.0.0-20180118031448-3f3ebedd6016/go.mod h1:nxr8UYB5P+7cpJPpqcbhMjfqm+GH3VDZQs2dFWibA68=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=

View File

@ -7,7 +7,6 @@ import (
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"time"
@ -15,6 +14,7 @@ import (
"github.com/gorilla/mux"
"git.thirdmartini.com/pub/fancylog"
"git.thirdmartini.com/pub/snap/auth"
)
@ -119,7 +119,7 @@ func (s *Server) parseTemplates(t *template.Template, filenames ...string) (*tem
func (s *Server) loadTemplates() *template.Template {
tmpl := template.New("")
err := filepath.Walk(path.Join(s.path, s.templates), func(path string, info os.FileInfo, err error) error {
err := filepath.Walk(s.templates, func(path string, info os.FileInfo, err error) error {
if strings.Contains(path, ".html") {
_, err := s.parseTemplates(tmpl, path)
if err != nil {

10
server_test.go Normal file
View File

@ -0,0 +1,10 @@
package snap
import (
"testing"
)
func TestServer(t *testing.T) {
}