1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-29 22:56:37 -04:00

api: run go fmt

This commit is contained in:
Adhityaa
2018-06-10 23:13:42 +05:30
parent 42a58f1d87
commit 8b0d198934
10 changed files with 27 additions and 28 deletions

View File

@ -6,10 +6,10 @@ import (
"github.com/gorilla/mux"
"html/template"
"io/ioutil"
"mime"
"net/http"
"os"
"path"
"mime"
)
func redirectLogin(w http.ResponseWriter, r *http.Request) {
@ -52,7 +52,7 @@ func initStaticRouter(router *mux.Router) error {
prefix += "window.commento_cdn='" + os.Getenv("CDN_PREFIX") + "';\n"
}
asset[p] = prefix + string(contents);
asset[p] = prefix + string(contents)
router.HandleFunc(p, func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", mime.TypeByExtension(path.Ext(r.URL.Path)))
@ -95,7 +95,7 @@ func initStaticRouter(router *mux.Router) error {
}
for _, page := range pages {
router.HandleFunc("/" + page, func(w http.ResponseWriter, r *http.Request) {
router.HandleFunc("/"+page, func(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, html[r.URL.Path])
})
}