Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint Issues #4150

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading