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

Unreachable continue in loop #17293

Closed
chavacava opened this issue Oct 12, 2021 · 1 comment · Fixed by #17304
Closed

Unreachable continue in loop #17293

chavacava opened this issue Oct 12, 2021 · 1 comment · Fixed by #17304
Labels
Milestone

Comments

@chavacava
Copy link
Contributor

chavacava commented Oct 12, 2021

for _, reg := range list {
r, err := reg.Parse()
if err != nil {
log.Fatal("parsing u2f registration: %v", err)
continue
}
regs = append(regs, *r)
}

The continue statement at line 85 is unreachable, the loop will exit if control reaches the log.Fatal at line 84.

Same problem at

for _, reg := range regs {
r, err := reg.Parse()
if err != nil {
log.Fatal("parsing u2f registration: %v", err)
continue
}

(Found with revive)

@zeripath
Copy link
Contributor

These should not be log.Fatal...

log.Error is the appropriate level.

@lunny lunny added the type/bug label Oct 14, 2021
@lunny lunny added this to the 1.16.0 milestone Oct 14, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants