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

Fix golangci-lint for context string key unittest #328

Merged
merged 1 commit into from
Mar 17, 2020

Conversation

zhouzhuojie
Copy link
Collaborator

Description

Motivation and Context

Fix golangci-lint:

#!/bin/bash -eo pipefail
make ci
Running verify_lint
pkg/handler/subject_test.go:26:31: SA1029: should not use built-in type string as key for value; define your own type to avoid collisions (staticcheck)
	ctx = context.WithValue(ctx, interface{}(config.Config.JWTAuthUserProperty), &jwt.Token{})
	                             ^
pkg/handler/subject_test.go:29:31: SA1029: should not use built-in type string as key for value; define your own type to avoid collisions (staticcheck)
	ctx = context.WithValue(ctx, interface{}(config.Config.JWTAuthUserProperty), &jwt.Token{
	                             ^
make: *** [Makefile:66: verify_lint] Error 1

Exited with code exit status 2

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@zhouzhuojie zhouzhuojie merged commit 6f8bf7b into master Mar 17, 2020
@zhouzhuojie zhouzhuojie deleted the zz/fix-context-value-type branch March 17, 2020 01:26
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

Successfully merging this pull request may close these issues.

1 participant