Skip to content

Commit

Permalink
format code (gofmt + trim trailing space) (#1452)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkd authored and vishr committed Jan 25, 2020
1 parent 8d7f05e commit 712b5e4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/xml"
"errors"
"fmt"
"github.com/labstack/gommon/log"
"io"
"math"
"mime/multipart"
Expand All @@ -19,6 +18,7 @@ import (
"text/template"
"time"

"github.com/labstack/gommon/log"
testify "github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion middleware/cors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions middleware/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
)

Expand Down Expand Up @@ -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)
}
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion middleware/jwt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 712b5e4

Please sign in to comment.