From 9f4de58d4fc433d2a58d7281da789952afa65f84 Mon Sep 17 00:00:00 2001 From: longze chen Date: Tue, 6 Nov 2018 11:53:00 -0500 Subject: [PATCH] Fix styles --- fakecas.go | 21 +++++++++++---------- utils.go | 3 ++- views.go | 3 ++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/fakecas.go b/fakecas.go index 449c7f0..4500de9 100644 --- a/fakecas.go +++ b/fakecas.go @@ -4,11 +4,12 @@ import ( "database/sql" "flag" "fmt" - "github.com/labstack/echo" - "github.com/labstack/echo/middleware" - _ "github.com/lib/pq" "html/template" "os" + + "github.com/labstack/echo" + "github.com/labstack/echo/middleware" + _ "github.com/lib/pq" ) var Version string @@ -31,12 +32,12 @@ func main() { })) e.Use(middleware.Recover()) - e.Use(middleware.CORSWithConfig(middleware.CORSConfig{ + e.Use(middleware.CORSWithConfig(middleware.CORSConfig{ AllowCredentials: true, - AllowOrigins: []string{"*"}, - AllowMethods: []string{"GET", "PUT", "POST", "DELETE"}, - AllowHeaders: []string{"Range", "Content-Type", "Authorization", "X-Requested-With"}, - ExposeHeaders: []string{"Range", "Content-Type", "Authorization", "X-Requested-With"}, + AllowOrigins: []string{"*"}, + AllowMethods: []string{"GET", "PUT", "POST", "DELETE"}, + AllowHeaders: []string{"Range", "Content-Type", "Authorization", "X-Requested-With"}, + ExposeHeaders: []string{"Range", "Content-Type", "Authorization", "X-Requested-With"}, })) t, err := template.New("login").Parse(LOGINPAGE) @@ -44,7 +45,7 @@ func main() { panic(err) } temp := &Template{templates: t} - e.Renderer = temp + e.Renderer = temp e.GET("/login", LoginGET) e.POST("/login", LoginPOST) @@ -62,5 +63,5 @@ func main() { defer DatabaseConnection.Close() - e.Start(*Host) + e.Start(*Host) } diff --git a/utils.go b/utils.go index faa915d..8ff5bec 100644 --- a/utils.go +++ b/utils.go @@ -1,9 +1,10 @@ package main import ( - "github.com/labstack/echo" "io" "net/url" + + "github.com/labstack/echo" ) func ValidateService(c echo.Context) *url.URL { diff --git a/views.go b/views.go index 2acb768..d553646 100644 --- a/views.go +++ b/views.go @@ -3,10 +3,11 @@ package main import ( "database/sql" "fmt" - "github.com/labstack/echo" "net/http" "net/url" "strings" + + "github.com/labstack/echo" ) func LoginPOST(c echo.Context) error {