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

crypto/tls: superfluous "return" in generate_cert.go #53198

Closed
JeremyRand opened this issue Jun 2, 2022 · 2 comments
Closed

crypto/tls: superfluous "return" in generate_cert.go #53198

JeremyRand opened this issue Jun 2, 2022 · 2 comments
Labels
NeedsFix Testing
Milestone

Comments

@JeremyRand
Copy link

@JeremyRand JeremyRand commented Jun 2, 2022

What version of Go are you using (go version)?

Git 46ab7a5

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

linux/ppc64le, but that seems inapplicable to this issue.

What did you do?

Read the source for generate_cert.go, saw what looks like a superfluous return.

if err != nil {
log.Fatalf("Failed to open key.pem for writing: %v", err)
return
}

What did you expect to see?

	if err != nil {
		log.Fatalf("Failed to open key.pem for writing: %v", err)
	}

No return, since log.Fatalf makes it unnecessary, just like in the rest of the file.

What did you see instead?

	if err != nil {
		log.Fatalf("Failed to open key.pem for writing: %v", err)
		return
	}

The return seems unnecessary, and doesn't match the style in the rest of the file when log.Fatalf is used.

@dmitshur dmitshur added the NeedsFix label Jun 3, 2022
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Jun 3, 2022

Thanks for reporting. This is a valid issue, albeit very minor. Please feel free to mail a change that removes the extra return, since it's indeed not needed and inconsistent. (It's also okay to mail a CL right away for an issue like this.) Thanks.

@dmitshur dmitshur added this to the Backlog milestone Jun 3, 2022
@dmitshur dmitshur added the Testing label Jun 3, 2022
cuiweixie added a commit to cuiweixie/go that referenced this issue Aug 3, 2022
@gopherbot
Copy link

@gopherbot gopherbot commented Aug 3, 2022

Change https://go.dev/cl/420935 mentions this issue: crypto: delete unnecessary line of return

@dmitshur dmitshur modified the milestones: Backlog, Go1.20 Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix Testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants