1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-12 01:22:21 +02:00

format code (gofmt + trim trailing space) (#1452)

This commit is contained in:
Dmitry Kutakov 2020-01-25 18:48:53 +01:00 committed by Vishal Rana
parent 8d7f05e533
commit 712b5e46c5
4 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,6 @@ import (
"encoding/xml"
"errors"
"fmt"
"github.com/labstack/gommon/log"
"io"
"math"
"mime/multipart"
@ -19,6 +18,7 @@ import (
"text/template"
"time"
"github.com/labstack/gommon/log"
testify "github.com/stretchr/testify/assert"
)

View File

@ -73,7 +73,7 @@ func TestCORS(t *testing.T) {
c = e.NewContext(req, rec)
req.Header.Set(echo.HeaderOrigin, "http://aaa.example.com")
cors = CORSWithConfig(CORSConfig{
AllowOrigins: []string{"http://*.example.com"},
AllowOrigins: []string{"http://*.example.com"},
})
h = cors(echo.NotFoundHandler)
h(c)

View File

@ -25,7 +25,7 @@ type (
// ErrorHandler defines a function which is executed for an invalid token.
// It may be used to define a custom JWT error.
ErrorHandler JWTErrorHandler
// ErrorHandlerWithContext is almost identical to ErrorHandler, but it's passed the current context.
ErrorHandlerWithContext JWTErrorHandlerWithContext
@ -74,7 +74,7 @@ type (
// JWTErrorHandlerWithContext is almost identical to JWTErrorHandler, but it's passed the current context.
JWTErrorHandlerWithContext func(error, echo.Context) error
jwtExtractor func(echo.Context) (string, error)
)
@ -183,7 +183,7 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
if config.ErrorHandler != nil {
return config.ErrorHandler(err)
}
if config.ErrorHandlerWithContext != nil {
return config.ErrorHandlerWithContext(err, c)
}
@ -210,7 +210,7 @@ func JWTWithConfig(config JWTConfig) echo.MiddlewareFunc {
return config.ErrorHandler(err)
}
if config.ErrorHandlerWithContext != nil {
return config.ErrorHandlerWithContext(err, c)
return config.ErrorHandlerWithContext(err, c)
}
return &echo.HTTPError{
Code: http.StatusUnauthorized,

View File

@ -205,7 +205,7 @@ func TestJWT(t *testing.T) {
req.Header.Set(echo.HeaderCookie, tc.hdrCookie)
c := e.NewContext(req, res)
if tc.reqURL == "/" + token {
if tc.reqURL == "/"+token {
c.SetParamNames("jwt")
c.SetParamValues(token)
}