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

false positive on aws.Context #6

Closed
SVilgelm opened this issue Aug 26, 2022 · 4 comments
Closed

false positive on aws.Context #6

SVilgelm opened this issue Aug 26, 2022 · 4 comments

Comments

@SVilgelm
Copy link

SVilgelm commented Aug 26, 2022

Hi, we do use a lot the aws-sdk-go lib and all their functions use an alias of context: https://github.com/aws/aws-sdk-go/blob/main/aws/context_1_9.go#L12

so the contextcheck fails on the code that uses those functions:

aws/awsCaller.go:34:53: Function `GetCallerIdentityWithContext` should pass the context parameter (contextcheck)
        callerId, err = awsSTS.GetCallerIdentityWithContext(ctx, &sts.GetCallerIdentityInput{})

when

func (c *STS) GetCallerIdentityWithContext(ctx aws.Context, input *GetCallerIdentityInput, opts ...request.Option) (*GetCallerIdentityOutput, error) {
	req, out := c.GetCallerIdentityRequest(input)
	req.SetContext(ctx)
	req.ApplyOptions(opts...)
	return out, req.Send()
}

Could you please add a check is the first parameter is an alias of the context.Context, like it is done in aws-sdk-go

@SVilgelm
Copy link
Author

it is impossible to exclude all the functions from aws-sdk-go, because there are lot of them :)

@kkHAIKE
Copy link
Owner

kkHAIKE commented Aug 27, 2022

have you tried the last version of golang-ci

@kkHAIKE
Copy link
Owner

kkHAIKE commented Aug 27, 2022

fixed, wait next golang-ci release 😊

@SVilgelm
Copy link
Author

thank you very much!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants