From c6c85989caf58781ba59c55c223ffd77ffb3995b Mon Sep 17 00:00:00 2001 From: Nishanth Shanmugham Date: Mon, 13 Nov 2023 02:05:52 +0000 Subject: [PATCH] test case requires directive comment to be meaningful --- .../default-not-required/default_not_required.go | 4 +++- .../default-required/default_required.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/testdata/src/default-case-required/default-not-required/default_not_required.go b/testdata/src/default-case-required/default-not-required/default_not_required.go index f02dce8..63e22b4 100644 --- a/testdata/src/default-case-required/default-not-required/default_not_required.go +++ b/testdata/src/default-case-required/default-not-required/default_not_required.go @@ -46,14 +46,16 @@ func _e(t dcr.T) { } } - func _f() { +func _f() { // should not report because these are not enum switch // statements. + //exhaustive:enforce-default-case-required var x int switch x { case 0: } + //exhaustive:enforce-default-case-required switch { case x == 0: } diff --git a/testdata/src/default-case-required/default-required/default_required.go b/testdata/src/default-case-required/default-required/default_required.go index 33ce104..1368eaa 100644 --- a/testdata/src/default-case-required/default-required/default_required.go +++ b/testdata/src/default-case-required/default-required/default_required.go @@ -36,7 +36,7 @@ func _d(t dcr.T) { } } - func _e() { +func _e() { // should not report because these are not enum switch // statements. var x int