clean up controllers

This commit is contained in:
sentriz
2020-03-26 00:57:56 +00:00
parent 59461552ae
commit b63428344a
7 changed files with 152 additions and 181 deletions

View File

@@ -13,6 +13,15 @@ import (
"senan.xyz/g/gonic/server/lastfm"
)
func firstExisting(or string, strings ...string) string {
for _, s := range strings {
if s != "" {
return s
}
}
return or
}
func (c *Controller) ServeNotFound(r *http.Request) *Response {
return &Response{template: "not_found.tmpl", code: 404}
}