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 golint warnings #170

Merged
merged 20 commits into from
Mar 9, 2020
Merged

Fix golint warnings #170

merged 20 commits into from
Mar 9, 2020

Conversation

shogo82148
Copy link
Contributor

Issue #, if available:

Description of changes:

There are some golangci-lint warnings.
https://travis-ci.org/aws/aws-xray-sdk-go/jobs/635402231

This pull request will fix them.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@bhautikpip
Copy link
Contributor

bhautikpip commented Jan 14, 2020

Hi @shogo82148,

Thanks for opening this PR. Really appreciate your efforts! test cases are failing in lambda_go.test. Looks like could because of new context key introduced ?

@shogo82148
Copy link
Contributor Author

I think it is another problem, because the recent commit 62e6c36 didn't change TestLambdaSegmentEmit and lambda_go.test.


I'm worrying that f6352d3 may not be acceptable.
because it changes the public field name of sampling.Request and breaks compatibility.
The direct use of sampling.Request is very rare case, so I think it doesn't have a large impact.
This change comes from https://github.com/golang/go/wiki/CodeReviewComments#initialisms .
Do you mind it?

@shogo82148
Copy link
Contributor Author

oh, the context key "x-amzn-trace-id" in AWS Lambda is hard coded in the aws-lambda-go.
https://github.com/aws/aws-lambda-go/blob/b5b7267d297de263cc5b61f8c37543daa9c95ffd/lambda/function.go#L65
I will revert it.

@bhautikpip bhautikpip self-requested a review February 25, 2020 23:09
strategy/sampling/sampling_rule.go Outdated Show resolved Hide resolved
strategy/sampling/sampling_rule_manifest.go Show resolved Hide resolved
strategy/sampling/sampling_test.go Show resolved Hide resolved
@@ -8,6 +8,9 @@ import (
)

func TestLambdaSegmentEmit(t *testing.T) {
// go-lint warns "should not use basic type string as key in context.WithValue",
// but it must be string type because the trace header comes from aws/aws-lambda-go.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might want to remove this comment.

@shogo82148 shogo82148 requested a review from bhautikpip March 2, 2020 11:20
@bhautikpip
Copy link
Contributor

bhautikpip commented Mar 2, 2020

Hi @shogo82148,

test case is failing because of this line (segment.go - Line 98) (https://github.com/aws/aws-xray-sdk-go/pull/170/files#diff-4178d11b198e2b2e67f13586d5f83fc5R98). We might need to change this as URL and then we should be good to go with this changes.

@bhautikpip
Copy link
Contributor

Hi @shogo82148,

would you mind resolving the conflicts and add URL (segment.go - Line 98) instead of Url. This is PR is good to go other than that.

Copy link
Contributor

@bhautikpip bhautikpip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@bhautikpip bhautikpip merged commit fff49d3 into aws:master Mar 9, 2020
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.

2 participants