api: run go fmt
This commit is contained in:
parent
42a58f1d87
commit
8b0d198934
@ -32,7 +32,7 @@ func commenterNew(email string, name string, link string, photo string, provider
|
||||
}
|
||||
|
||||
passwordHash := []byte{}
|
||||
if (password != "") {
|
||||
if password != "" {
|
||||
passwordHash, err = bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
|
||||
if err != nil {
|
||||
logger.Errorf("cannot generate hash from password: %v\n", err)
|
||||
@ -54,7 +54,6 @@ func commenterNew(email string, name string, link string, photo string, provider
|
||||
return commenterHex, nil
|
||||
}
|
||||
|
||||
|
||||
func commenterNewHandler(w http.ResponseWriter, r *http.Request) {
|
||||
type request struct {
|
||||
Email *string `json:"email"`
|
||||
|
@ -2,8 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func parseConfig() error {
|
||||
|
@ -2,8 +2,8 @@ package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestParseConfigBasics(t *testing.T) {
|
||||
|
@ -37,7 +37,7 @@ func googleOauthConfigure() error {
|
||||
Endpoint: google.Endpoint,
|
||||
}
|
||||
|
||||
configuredOauths = append(configuredOauths, "google");
|
||||
configuredOauths = append(configuredOauths, "google")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
@ -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)))
|
||||
|
@ -1,9 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"os"
|
||||
)
|
||||
|
||||
var headerTemplate *template.Template
|
||||
|
Loading…
Reference in New Issue
Block a user