diff --git a/http/go.mod b/http/go.mod index debf689..d58d3a4 100644 --- a/http/go.mod +++ b/http/go.mod @@ -5,7 +5,7 @@ go 1.23.3 toolchain go1.24.5 require ( - github.com/Teajey/rsvp v0.13.1 + github.com/Teajey/rsvp v0.14.0 github.com/gorilla/sessions v1.4.0 golang.org/x/crypto v0.39.0 ) diff --git a/http/go.sum b/http/go.sum index b36c5c0..88ffc99 100644 --- a/http/go.sum +++ b/http/go.sum @@ -1,5 +1,5 @@ -github.com/Teajey/rsvp v0.13.1 h1:0lw+JosaWmdjSmXoKQYBRS9nptSZPInm60Y5GQ3llEU= -github.com/Teajey/rsvp v0.13.1/go.mod h1:z0L20VphVg+Ec2+hnpLFTG2MZTrWYFprav1kpxDba0Q= +github.com/Teajey/rsvp v0.14.0 h1:BkmMRQhmOtzSbWLaW4wbg73VNzK/FXlVDCgxRqkTNNs= +github.com/Teajey/rsvp v0.14.0/go.mod h1:z0L20VphVg+Ec2+hnpLFTG2MZTrWYFprav1kpxDba0Q= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= diff --git a/http/handler/public.go b/http/handler/public.go new file mode 100644 index 0000000..864cdce --- /dev/null +++ b/http/handler/public.go @@ -0,0 +1,19 @@ +package handler + +import ( + "net/http" + + "github.com/Teajey/rsvp" + + "lishwist/http/session" +) + +type Public interface { + ServeHTTP(*session.Session, http.Header, *http.Request) rsvp.Response +} + +type PublicFunc func(*session.Session, http.Header, *http.Request) rsvp.Response + +func (f PublicFunc) ServeHTTP(s *session.Session, h http.Header, r *http.Request) rsvp.Response { + return f(s, h, r) +} diff --git a/http/mux/private.go b/http/mux/private.go new file mode 100644 index 0000000..dce4616 --- /dev/null +++ b/http/mux/private.go @@ -0,0 +1,58 @@ +package mux + +import ( + "log" + "net/http" + + "github.com/Teajey/rsvp" + + "lishwist/http/handler" + "lishwist/http/session" + "lishwist/http/templates" + "lishwist/http/templates/text" +) + +type Private struct { + inner *rsvp.ServeMux + store *session.Store +} + +func newPrivate(store *session.Store) *Private { + mux := rsvp.NewServeMux() + mux.Config.HtmlTemplate = templates.Template + mux.Config.TextTemplate = text.Template + return &Private{ + inner: mux, + store: store, + } +} + +func (m *Private) ServeHTTP(w http.ResponseWriter, r *http.Request) { + m.inner.ServeHTTP(w, r) +} + +func (m *Private) GetSession(r *http.Request) *session.Session { + innerSession, _ := m.store.Get(r, "lishwist_user") + return session.New(innerSession) +} + +func (m *Private) Handle(pattern string, handler handler.Public) { + m.inner.Std.HandleFunc(pattern, rsvp.MiddlewareBeforeWriteResponse(m.inner.Config, rsvp.MiddleHandlerFunc(func(w http.ResponseWriter, r *http.Request) rsvp.Response { + session := m.GetSession(r) + + response := handler.ServeHTTP(session, w.Header(), r) + + if session.WasWritten() { + err := session.Save(r, w) + if err != nil { + log.Printf("Failed to save session: %s\n", err) + } + } + + return response + }))) +} + +func (m *Private) HandleFunc(pattern string, handler handler.PublicFunc) { + m.Handle(pattern, handler) +} diff --git a/http/mux/serve.go b/http/mux/serve.go new file mode 100644 index 0000000..bcaf9ea --- /dev/null +++ b/http/mux/serve.go @@ -0,0 +1,38 @@ +package mux + +import ( + "net/http" + + "lishwist/http/handler" + "lishwist/http/session" +) + +type Serve struct { + store *session.Store + Public *Private + Private *Private +} + +func (s *Serve) ServeHTTP(w http.ResponseWriter, r *http.Request) { + session, _ := s.store.Get(r, "lishwist_user") + _, inSession := session.Values["sessionKey"] + + if inSession { + s.Private.ServeHTTP(w, r) + } else { + s.Public.ServeHTTP(w, r) + } +} + +func New(store *session.Store) *Serve { + return &Serve{ + store: store, + Public: newPrivate(store), + Private: newPrivate(store), + } +} + +func (r *Serve) HandleFunc(pattern string, handler handler.PublicFunc) { + r.Public.HandleFunc(pattern, handler) + r.Private.HandleFunc(pattern, handler) +} diff --git a/http/response/handler.go b/http/response/handler.go deleted file mode 100644 index 33c0d7c..0000000 --- a/http/response/handler.go +++ /dev/null @@ -1,58 +0,0 @@ -package response - -import ( - "log" - "net/http" - - "lishwist/http/session" - "lishwist/http/templates" - "lishwist/http/templates/text" - - "github.com/Teajey/rsvp" -) - -type ServeMux struct { - inner *rsvp.ServeMux - store *session.Store -} - -func NewServeMux(store *session.Store) *ServeMux { - mux := rsvp.NewServeMux() - mux.Config.HtmlTemplate = templates.Template - mux.Config.TextTemplate = text.Template - return &ServeMux{ - inner: mux, - store: store, - } -} - -func (m *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { - m.inner.ServeHTTP(w, r) -} - -type Handler interface { - ServeHTTP(*Session, http.Header, *http.Request) rsvp.Response -} - -type HandlerFunc func(*Session, http.Header, *http.Request) rsvp.Response - -func (m *ServeMux) HandleFunc(pattern string, handler HandlerFunc) { - m.inner.MiddleHandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) rsvp.Response { - session := m.GetSession(r) - - response := handler(session, w.Header(), r) - - if session.written { - err := session.inner.Save(r, w) - if err != nil { - log.Printf("Failed to save session: %s\n", err) - } - } - - return response - }) -} - -func (m *ServeMux) Handle(pattern string, handler Handler) { - m.HandleFunc(pattern, handler.ServeHTTP) -} diff --git a/http/response/request.go b/http/response/request.go deleted file mode 100644 index a14e51f..0000000 --- a/http/response/request.go +++ /dev/null @@ -1,10 +0,0 @@ -package response - -import ( - "net/http" -) - -func (m *ServeMux) GetSession(r *http.Request) *Session { - session, _ := m.store.Get(r, "lishwist_user") - return &Session{inner: session} -} diff --git a/http/router/router.go b/http/router/router.go deleted file mode 100644 index 5039b7d..0000000 --- a/http/router/router.go +++ /dev/null @@ -1,38 +0,0 @@ -package router - -import ( - "net/http" - - "lishwist/http/response" - "lishwist/http/session" -) - -type VisibilityRouter struct { - store *session.Store - Public *response.ServeMux - Private *response.ServeMux -} - -func (s *VisibilityRouter) ServeHTTP(w http.ResponseWriter, r *http.Request) { - session, _ := s.store.Get(r, "lishwist_user") - _, inSession := session.Values["sessionKey"] - - if inSession { - s.Private.ServeHTTP(w, r) - } else { - s.Public.ServeHTTP(w, r) - } -} - -func New(store *session.Store) *VisibilityRouter { - return &VisibilityRouter{ - store: store, - Public: response.NewServeMux(store), - Private: response.NewServeMux(store), - } -} - -func (r *VisibilityRouter) HandleFunc(pattern string, handler response.HandlerFunc) { - r.Public.HandleFunc(pattern, handler) - r.Private.HandleFunc(pattern, handler) -} diff --git a/http/routing/account.go b/http/routing/account.go index 2ba3996..cf3771f 100644 --- a/http/routing/account.go +++ b/http/routing/account.go @@ -8,6 +8,7 @@ import ( "lishwist/http/props" "lishwist/http/props/htmlx" "lishwist/http/response" + "lishwist/http/session" "lishwist/http/templates" "github.com/Teajey/rsvp" @@ -63,7 +64,7 @@ func NewAccountProps(username string, passwordFromAdmin bool, passwordVal, confi } } -func Account(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func Account(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { user := app.User() props := NewAccountProps(user.Name, user.PasswordFromAdmin, "", "") @@ -78,7 +79,7 @@ func Account(app *lishwist.Session, session *response.Session, h http.Header, r return response.Data("account.gotmpl", props) } -func AccountPost(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func AccountPost(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { user := app.User() err := r.ParseForm() diff --git a/http/routing/config.go b/http/routing/config.go index 2f18f28..7ffd50e 100644 --- a/http/routing/config.go +++ b/http/routing/config.go @@ -3,7 +3,7 @@ package routing import ( lishwist "lishwist/core" "lishwist/http/env" - "lishwist/http/response" + "lishwist/http/session" "net/http" "github.com/Teajey/rsvp" @@ -14,7 +14,7 @@ type HealthProps struct { Config env.Config } -func Health(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func Health(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { if app.Admin() == nil { return rsvp.Ok() } diff --git a/http/routing/context.go b/http/routing/context.go index 06769d5..e410ddd 100644 --- a/http/routing/context.go +++ b/http/routing/context.go @@ -4,15 +4,16 @@ import ( "log" "net/http" - lishwist "lishwist/core" - - "lishwist/http/response" - "github.com/Teajey/rsvp" + + lishwist "lishwist/core" + "lishwist/http/handler" + "lishwist/http/response" + "lishwist/http/session" ) -func ExpectAppSession(next func(*lishwist.Session, *response.Session, http.Header, *http.Request) rsvp.Response) response.HandlerFunc { - return func(session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func ExpectAppSession(next func(*lishwist.Session, *session.Session, http.Header, *http.Request) rsvp.Response) handler.PublicFunc { + return func(session *session.Session, h http.Header, r *http.Request) rsvp.Response { sessionKey, ok := session.GetValue("sessionKey").(string) if !ok { log.Printf("Failed to get key from session\n") diff --git a/http/routing/events.go b/http/routing/events.go index 554218a..3473be1 100644 --- a/http/routing/events.go +++ b/http/routing/events.go @@ -3,6 +3,7 @@ package routing import ( lishwist "lishwist/core" "lishwist/http/response" + "lishwist/http/session" "log" "net/http" @@ -13,7 +14,7 @@ type Events struct { Events []lishwist.Event `xml:"Event"` } -func EventList(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func EventList(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { admin := app.Admin() if admin == nil { log.Println("Attempt to access EventList by non-admin. Responding 404 Not Found.") diff --git a/http/routing/foreign_wishlist.go b/http/routing/foreign_wishlist.go index b8c00a9..632fab5 100644 --- a/http/routing/foreign_wishlist.go +++ b/http/routing/foreign_wishlist.go @@ -3,6 +3,7 @@ package routing import ( lishwist "lishwist/core" "lishwist/http/response" + "lishwist/http/session" "lishwist/http/templates" "log" "net/http" @@ -18,7 +19,7 @@ type foreignWishlistProps struct { Gifts []lishwist.Wish } -func ForeignWishlist(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func ForeignWishlist(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { userReference := r.PathValue("userReference") user := app.User() if user.Reference == userReference { @@ -47,7 +48,7 @@ type publicWishlistProps struct { GiftCount int } -func PublicWishlist(s *response.Session, h http.Header, r *http.Request) rsvp.Response { +func PublicWishlist(s *session.Session, h http.Header, r *http.Request) rsvp.Response { userReference := r.PathValue("userReference") otherUser, err := lishwist.GetUserByReference(userReference) if err != nil { diff --git a/http/routing/groups.go b/http/routing/groups.go index 8870be5..d5de652 100644 --- a/http/routing/groups.go +++ b/http/routing/groups.go @@ -8,6 +8,7 @@ import ( lishwist "lishwist/core" "lishwist/http/response" + "lishwist/http/session" "lishwist/http/templates" "github.com/Teajey/rsvp" @@ -39,7 +40,7 @@ func AdminGroup(app *lishwist.Session, h http.Header, r *http.Request) rsvp.Resp return response.Data("group_page.gotmpl", p) } -func Group(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func Group(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { user := app.User() if user.IsAdmin { return AdminGroup(app, h, r) @@ -62,7 +63,7 @@ func Group(app *lishwist.Session, session *response.Session, h http.Header, r *h return response.Data("group_page.gotmpl", p) } -func PublicGroup(s *response.Session, h http.Header, r *http.Request) rsvp.Response { +func PublicGroup(s *session.Session, h http.Header, r *http.Request) rsvp.Response { groupReference := r.PathValue("groupReference") group, err := lishwist.GetGroupByReference(groupReference) if err != nil { @@ -79,7 +80,7 @@ func PublicGroup(s *response.Session, h http.Header, r *http.Request) rsvp.Respo return response.Data("public_group_page.gotmpl", p) } -func GroupPost(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func GroupPost(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { admin := app.Admin() if admin == nil { return response.NotFound() @@ -149,7 +150,7 @@ type GroupList struct { Groups []lishwist.Group `xml:"Group"` } -func Groups(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func Groups(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { admin := app.Admin() if admin == nil { return response.NotFound() diff --git a/http/routing/home.go b/http/routing/home.go index 334a992..22e652d 100644 --- a/http/routing/home.go +++ b/http/routing/home.go @@ -7,6 +7,7 @@ import ( lishwist "lishwist/core" "lishwist/http/env" "lishwist/http/response" + "lishwist/http/session" "lishwist/http/templates" "github.com/Teajey/rsvp" @@ -19,7 +20,7 @@ type HomeProps struct { Groups []lishwist.Group } -func Home(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func Home(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { gifts, err := app.GetWishes() if err != nil { log.Printf("Failed to get gifts: %s\n", err) @@ -43,7 +44,7 @@ func Home(app *lishwist.Session, session *response.Session, h http.Header, r *ht return response.Data("home.gotmpl", p) } -func HomePost(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func HomePost(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { err := r.ParseForm() if err != nil { return response.Error(http.StatusBadRequest, "Failed to parse form") diff --git a/http/routing/login.go b/http/routing/login.go index 9c3f761..e50e10a 100644 --- a/http/routing/login.go +++ b/http/routing/login.go @@ -10,11 +10,12 @@ import ( "lishwist/http/props" "lishwist/http/props/htmlx" "lishwist/http/response" + "lishwist/http/session" "github.com/Teajey/rsvp" ) -func Login(s *response.Session, h http.Header, r *http.Request) rsvp.Response { +func Login(s *session.Session, h http.Header, r *http.Request) rsvp.Response { login := props.NewLogin("", "") flash := s.FlashGet() @@ -34,7 +35,7 @@ func Login(s *response.Session, h http.Header, r *http.Request) rsvp.Response { return rsvp.Response{TemplateName: "login.gotmpl", Body: body} } -func LoginPost(session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func LoginPost(session *session.Session, h http.Header, r *http.Request) rsvp.Response { username, password, ok := r.BasicAuth() if !ok { err := r.ParseForm() diff --git a/http/routing/logout.go b/http/routing/logout.go index f32ffd6..5a35440 100644 --- a/http/routing/logout.go +++ b/http/routing/logout.go @@ -1,13 +1,13 @@ package routing import ( - "lishwist/http/response" + "lishwist/http/session" "net/http" "github.com/Teajey/rsvp" ) -func LogoutPost(session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func LogoutPost(session *session.Session, h http.Header, r *http.Request) rsvp.Response { session.Options().MaxAge = 0 session.ClearValues() diff --git a/http/routing/not_found.go b/http/routing/not_found.go index 5ebc6c4..875cf38 100644 --- a/http/routing/not_found.go +++ b/http/routing/not_found.go @@ -4,10 +4,11 @@ import ( "net/http" "lishwist/http/response" + "lishwist/http/session" "github.com/Teajey/rsvp" ) -func NotFound(s *response.Session, h http.Header, r *http.Request) rsvp.Response { +func NotFound(s *session.Session, h http.Header, r *http.Request) rsvp.Response { return response.Error(http.StatusNotFound, "Page not found") } diff --git a/http/routing/register.go b/http/routing/register.go index 2fef3be..c0c4a49 100644 --- a/http/routing/register.go +++ b/http/routing/register.go @@ -5,13 +5,14 @@ import ( lishwist "lishwist/core" "lishwist/http/props" "lishwist/http/response" + "lishwist/http/session" "log" "net/http" "github.com/Teajey/rsvp" ) -func Register(session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func Register(session *session.Session, h http.Header, r *http.Request) rsvp.Response { register := props.NewRegister("", "", "") flash := session.FlashGet() @@ -28,7 +29,7 @@ func Register(session *response.Session, h http.Header, r *http.Request) rsvp.Re return response.Data("register.gotmpl", register) } -func RegisterPost(s *response.Session, h http.Header, r *http.Request) rsvp.Response { +func RegisterPost(s *session.Session, h http.Header, r *http.Request) rsvp.Response { var confirmPassword string username, newPassword, ok := r.BasicAuth() if ok { diff --git a/http/routing/users.go b/http/routing/users.go index 30f3c29..e1f4aa4 100644 --- a/http/routing/users.go +++ b/http/routing/users.go @@ -4,6 +4,7 @@ import ( "encoding/xml" lishwist "lishwist/core" "lishwist/http/response" + "lishwist/http/session" "net/http" "github.com/Teajey/rsvp" @@ -14,7 +15,7 @@ type UserList struct { Users []lishwist.User `xml:"User"` } -func Users(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func Users(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { admin := app.Admin() if admin == nil { return response.NotFound() @@ -28,7 +29,7 @@ func Users(app *lishwist.Session, session *response.Session, h http.Header, r *h return response.Data("", UserList{Users: users}) } -func User(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func User(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { admin := app.Admin() if admin == nil { return response.NotFound() @@ -47,7 +48,7 @@ func User(app *lishwist.Session, session *response.Session, h http.Header, r *ht return response.Data("", user) } -func UserPost(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func UserPost(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { admin := app.Admin() if admin == nil { return response.NotFound() diff --git a/http/routing/wishlist.go b/http/routing/wishlist.go index 188a0c3..02926a2 100644 --- a/http/routing/wishlist.go +++ b/http/routing/wishlist.go @@ -8,6 +8,7 @@ import ( lishwist "lishwist/core" "lishwist/http/response" + "lishwist/http/session" ) func WishlistAdd(app *lishwist.Session, h http.Header, r *http.Request) rsvp.Response { @@ -40,7 +41,7 @@ func WishlistDelete(app *lishwist.Session, h http.Header, r *http.Request) rsvp. return rsvp.SeeOther("/", "Wish deleted") } -func ForeignWishlistPost(app *lishwist.Session, session *response.Session, h http.Header, r *http.Request) rsvp.Response { +func ForeignWishlistPost(app *lishwist.Session, session *session.Session, h http.Header, r *http.Request) rsvp.Response { err := r.ParseForm() if err != nil { return response.Error(http.StatusBadRequest, "Failed to parse form") diff --git a/http/server/server.go b/http/server/server.go index 4fe8d70..73d188a 100644 --- a/http/server/server.go +++ b/http/server/server.go @@ -5,31 +5,31 @@ import ( "net/http" "strings" + "github.com/Teajey/rsvp" + "lishwist/http/env" + "lishwist/http/handler" + "lishwist/http/mux" "lishwist/http/props" - "lishwist/http/response" - "lishwist/http/router" "lishwist/http/routing" "lishwist/http/session" - - "github.com/Teajey/rsvp" ) -func prefixMovedPermanently(before, after string) response.HandlerFunc { - return func(s *response.Session, h http.Header, r *http.Request) rsvp.Response { +func prefixMovedPermanently(before, after string) handler.PublicFunc { + return func(s *session.Session, h http.Header, r *http.Request) rsvp.Response { suffix := strings.TrimPrefix(r.RequestURI, before) return rsvp.MovedPermanently(after + suffix) } } -func prefixPermanentRedirect(before, after string) response.HandlerFunc { - return func(s *response.Session, h http.Header, r *http.Request) rsvp.Response { +func prefixPermanentRedirect(before, after string) handler.PublicFunc { + return func(s *session.Session, h http.Header, r *http.Request) rsvp.Response { suffix := strings.TrimPrefix(r.RequestURI, before) return rsvp.PermanentRedirect(after + suffix) } } -func Create(useSecureCookies bool) *router.VisibilityRouter { +func Create(useSecureCookies bool) *mux.Serve { gob.Register(&props.Register{}) gob.Register(&props.Login{}) gob.Register(&routing.AccountProps{}) @@ -41,7 +41,7 @@ func Create(useSecureCookies bool) *router.VisibilityRouter { store.Options.Path = "/" store.Options.SameSite = http.SameSiteLaxMode - r := router.New(store) + r := mux.New(store) r.Public.HandleFunc("GET /", routing.Login) r.Public.HandleFunc("GET /groups/{groupReference}", routing.PublicGroup) diff --git a/http/response/session.go b/http/session/session.go similarity index 79% rename from http/response/session.go rename to http/session/session.go index 3ec625d..d1f69e3 100644 --- a/http/response/session.go +++ b/http/session/session.go @@ -1,6 +1,8 @@ -package response +package session import ( + "net/http" + "github.com/gorilla/sessions" ) @@ -9,6 +11,10 @@ type Session struct { written bool } +func New(inner *sessions.Session) *Session { + return &Session{inner: inner} +} + const flashKey = "_flash" func (s *Session) FlashGet() any { @@ -61,3 +67,11 @@ func (s *Session) ClearValues() { func (s *Session) Options() *sessions.Options { return s.inner.Options } + +func (s *Session) WasWritten() bool { + return s.written +} + +func (s *Session) Save(r *http.Request, w http.ResponseWriter) error { + return s.inner.Save(r, w) +} diff --git a/http/templates/text/template.go b/http/templates/text/template.go index 3851a19..1decbee 100644 --- a/http/templates/text/template.go +++ b/http/templates/text/template.go @@ -14,4 +14,3 @@ func load() *template.Template { t := template.Must(template.ParseGlob("templates/text/*.gotmpl")) return t } -