Code

Use the 'page' type in the error handler as well.
authorSebastian Harl <sh@tokkee.org>
Wed, 26 Nov 2014 21:03:31 +0000 (22:03 +0100)
committerSebastian Harl <sh@tokkee.org>
Wed, 26 Nov 2014 21:09:43 +0000 (22:09 +0100)
server/error.go

index 2afa44ab98e570c5d43c9aa08508599e0a986bea..270225a32473392bb4c1a932423a4c3ade058c6c 100644 (file)
@@ -30,7 +30,6 @@ package server
 import (
        "bytes"
        "fmt"
-       "html/template"
        "io"
        "log"
        "net/http"
@@ -51,11 +50,7 @@ func (s *Server) internal(w http.ResponseWriter, err error) {
 func (s *Server) err(w http.ResponseWriter, status int, err error) {
        log.Printf("%s: %v", http.StatusText(status), err)
 
-       page := struct {
-               Title   string
-               Query   string
-               Content template.HTML
-       }{
+       page := page{
                Title:   "SysDB - Error",
                Content: "<section class=\"error\">" + html(err.Error()) + "</section>",
        }