Skip to content

Unreachable continue in loop #17293

Closed
@chavacava

Description

@chavacava

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions