Skip to content

Commit

Permalink
add test cases of non-enum switches for -default-case-required
Browse files Browse the repository at this point in the history
  • Loading branch information
nishanths committed Nov 13, 2023
1 parent 67c4e6d commit 7e413c5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,16 @@ func _e(t dcr.T) {
default:
}
}

func _f() {
// should not report because these are not enum switch
// statements.
var x int
switch x {
case 0:
}

switch {
case x == 0:
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,16 @@ func _d(t dcr.T) {
default:
}
}

func _e() {
// should not report because these are not enum switch
// statements.
var x int
switch x {
case 0:
}

switch {
case x == 0:
}
}

0 comments on commit 7e413c5

Please sign in to comment.