Skip to content

Commit

Permalink
Merge pull request #4150 from nickmango/bug/go-lint-issues
Browse files Browse the repository at this point in the history
Lint Issues
  • Loading branch information
nickmango authored Oct 12, 2023
2 parents 680eced + fde2528 commit e06f3ef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
5 changes: 5 additions & 0 deletions cla-backend-go/utils/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,3 +219,8 @@ const GitLabRepositoryType = "GitLab"

// GitHubRepositoryType representing the GitLab repository type
const GitHubRepositoryType = "GitHub"

// ContextKey is the key for the context
type contextKey string

const XREQUESTIDKey contextKey = "x-request-id"
6 changes: 5 additions & 1 deletion cla-backend-go/v2/sign/docusign.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ func (s *service) getAccessToken(ctx context.Context) (string, error) {
return "", err
}

defer resp.Body.Close()
defer func() {
if err = resp.Body.Close(); err != nil {
log.WithFields(f).WithError(err).Warnf("problem closing the response body")
}
}()

// Parse the response
responsePayload, err := io.ReadAll(resp.Body)
Expand Down
2 changes: 1 addition & 1 deletion cla-backend-go/v2/sign/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func Configure(api *operations.EasyclaAPI, service Service) {
api.SignRequestIndividualSignatureHandler = sign.RequestIndividualSignatureHandlerFunc(
func(params sign.RequestIndividualSignatureParams) middleware.Responder {
reqId := utils.GetRequestID(params.XREQUESTID)
ctx := context.WithValue(params.HTTPRequest.Context(), utils.XREQUESTID, reqId)
ctx := context.WithValue(params.HTTPRequest.Context(), utils.XREQUESTIDKey, reqId)
f := logrus.Fields{
"functionName": "v2.sign.handlers.SignRequestIndividualSignatureHandler",
utils.XREQUESTID: ctx.Value(utils.XREQUESTID),
Expand Down
7 changes: 0 additions & 7 deletions cla-backend-go/v2/sign/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"io"
"net/http"
"os"
"strings"

"github.com/communitybridge/easycla/cla-backend-go/projects_cla_groups"
Expand All @@ -35,12 +34,6 @@ import (
"github.com/communitybridge/easycla/cla-backend-go/utils"
)

var (
integrationKey = os.Getenv("DOCUSIGN_INTEGRATOR_KEY")
userGUID = os.Getenv("DOCUSIGN_USER_ID")
privateKey = os.Getenv("DOCUSIGN_PRIVATE_KEY")
)

// constants
const (
DontLoadRepoDetails = false
Expand Down

0 comments on commit e06f3ef

Please sign in to comment.