1594 if code != exitCancel {
1595 util.KillCommand(cmd)
1596 os.Exit(code)
1597 } else {1598 select {
1599 case <-time.After(previewCancelWait):
1600 util.KillCommand(cmd)
271 restart(*nextCommand)
272 nextCommand = nil
273 break
274 } else {275 reading = reading && evt == EvtReadNew
276 }
277 snapshot, count := chunkList.Snapshot()
To ensure as little nesting as possible (to improve code readability), the
else
blocks that can be eliminated should be removed. For example, if the if
block contains a return
statement, the else
block can be omitted entirely.
for {
if ok := f(); ok {
a := 1
continue
} else {
return "it's NOT okay!"
}
}
for {
if ok := f(); ok {
a := 1
continue
}
return "it's NOT okay!"
}