Skip to content

Commit 846349d

Browse files
Address lint
Signed-off-by: Lukasz Gryglicki <[email protected]>
1 parent 5cd45c2 commit 846349d

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

cla-backend-go/cmd/server.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ func createUserFromRequest(authorizer auth.Authorizer, usersService users.Servic
659659
if !needToStoreUser {
660660
return r
661661
}
662-
ctx := context.WithValue(r.Context(), "user", userModel)
662+
ctx := context.WithValue(r.Context(), "user", userModel) // nolint
663663
return r.WithContext(ctx)
664664
}
665665

@@ -678,7 +678,7 @@ func createUserFromRequest(authorizer auth.Authorizer, usersService users.Servic
678678
if !needToStoreUser {
679679
return r
680680
}
681-
ctx := context.WithValue(r.Context(), "user", userModel)
681+
ctx := context.WithValue(r.Context(), "user", userModel) // nolint
682682
return r.WithContext(ctx)
683683
}
684684

@@ -705,6 +705,6 @@ func createUserFromRequest(authorizer auth.Authorizer, usersService users.Servic
705705
if !needToStoreUser {
706706
return r
707707
}
708-
ctx := context.WithValue(r.Context(), "user", userModel)
708+
ctx := context.WithValue(r.Context(), "user", userModel) // nolint
709709
return r.WithContext(ctx)
710710
}

cla-backend-go/v2/current_user/handlers.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package current_user
55

66
import (
77
"context"
8-
"fmt"
98

109
log "github.com/communitybridge/easycla/cla-backend-go/logging"
1110

@@ -23,7 +22,7 @@ func Configure(api *operations.EasyclaAPI, service Service) { // nolint
2322
api.CurrentUserGetUserFromTokenHandler = current_user.GetUserFromTokenHandlerFunc(
2423
func(params current_user.GetUserFromTokenParams, authUser *auth.User) middleware.Responder {
2524
reqID := utils.GetRequestID(params.XREQUESTID)
26-
ctx := context.WithValue(params.HTTPRequest.Context(), utils.XREQUESTID, reqID)
25+
ctx := context.WithValue(params.HTTPRequest.Context(), utils.XREQUESTID, reqID) // nolint
2726
utils.SetAuthUserProperties(authUser, params.XUSERNAME, params.XEMAIL)
2827
f := logrus.Fields{
2928
"functionName": "v2.current_user.handlers.GetUserFromToken",
@@ -34,7 +33,7 @@ func Configure(api *operations.EasyclaAPI, service Service) { // nolint
3433
log.WithFields(f).Debugf("looking for user from bearer token")
3534
userModel, err := service.UserFromContext(ctx)
3635
if err != nil {
37-
msg := fmt.Sprintf("unable to lookup user from token")
36+
msg := "unable to lookup user from token"
3837
log.WithFields(f).WithError(err).Warn(msg)
3938
return current_user.NewGetUserFromTokenNotFound().WithXRequestID(reqID).WithPayload(utils.ErrorResponseNotFound(reqID, msg))
4039
}

0 commit comments

Comments
 (0)