Use if/else if on error checking
Use switch statements for regular branching code.
This commit is contained in:
parent
fc1b929a81
commit
e0573fa68d
1 changed files with 2 additions and 4 deletions
|
|
@ -188,11 +188,9 @@ func padlock(state string, opts *LockOptions) error {
|
|||
|
||||
parent := alias[opts.ParentCmd]
|
||||
|
||||
switch {
|
||||
case err != nil:
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
case parent.Typename != issuePr.Typename:
|
||||
} else if parent.Typename != issuePr.Typename {
|
||||
return fmt.Errorf("%s #%d not found, but found %s #%d",
|
||||
alias[parent.Typename].FullName, issuePr.Number,
|
||||
strings.ToLower(alias[issuePr.Typename].FullName), issuePr.Number)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue