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

Report a coding bug about unused result. #4120

Closed
2 of 3 tasks
guodongli-google opened this issue Oct 2, 2021 · 2 comments · Fixed by #4138
Closed
2 of 3 tasks

Report a coding bug about unused result. #4120

guodongli-google opened this issue Oct 2, 2021 · 2 comments · Fixed by #4138
Labels
bug This issue is a bug. needs-review This issue or pull request needs review from a core team member.

Comments

@guodongli-google
Copy link

guodongli-google commented Oct 2, 2021

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
At https://github.com/aws/aws-sdk-go/blob/main/private/protocol/rest/unmarshal.go#L143, a new error is created but not returned, and function awserr.New has no side effect:

	if err != nil {
		awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err)
	}

Version of AWS SDK for Go?
The current version

Expected behavior
The correct code should be:

	if err != nil {
		return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err)
	}

Found by static analyzer #deepgo

@guodongli-google guodongli-google added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 2, 2021
@KaibaLopez
Copy link
Contributor

Hi @guodongli-google ,
Thanks for pointing this out to us

@KaibaLopez KaibaLopez added needs-review This issue or pull request needs review from a core team member. and removed needs-triage This issue or PR still needs to be triaged. labels Oct 7, 2021
jasdel pushed a commit that referenced this issue Dec 7, 2021
Fixes #4120 by returning error from unmarshalHeaderMap method.
@github-actions
Copy link

github-actions bot commented Dec 7, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-review This issue or pull request needs review from a core team member.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants