1
0
mirror of https://github.com/mgechev/revive.git synced 2025-03-29 21:47:12 +02:00

13 lines
712 B
Go

package ifelse
// Chain contains information about an if-else chain.
type Chain struct {
If Branch // what happens at the end of the "if" block
HasElse bool // is there an "else" block?
Else Branch // what happens at the end of the "else" block
HasInitializer bool // is there an "if"-initializer somewhere in the chain?
HasPriorNonDeviating bool // is there a prior "if" block that does NOT deviate control flow?
AtBlockEnd bool // whether the chain is placed at the end of the surrounding block
BlockEndKind BranchKind // control flow at end of surrounding block (e.g. "return" for function body)
}