Skip to content

Commit a2d624b

Browse files
committed
Add test showing bug
1 parent 5f1ed0e commit a2d624b

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎go/ql/test/query-tests/RedundantCode/UnreachableStatement/UnreachableStatement.expected‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
| main.go:147:2:147:17 | return statement | This statement is unreachable. |
1111
| main.go:153:2:153:22 | return statement | This statement is unreachable. |
1212
| main.go:159:2:159:43 | return statement | This statement is unreachable. |
13+
| main.go:164:2:164:10 | select statement | This statement is unreachable. |

‎go/ql/test/query-tests/RedundantCode/UnreachableStatement/main.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,4 +159,9 @@ func test19() mystruct {
159159
return mystruct{test10(1), test10(2) == 2} // $ Alert
160160
}
161161

162+
func test20() {
163+
go panic("panic in another goroutine")
164+
select {} // $ SPURIOUS: Alert // reachable after starting the goroutine
165+
}
166+
162167
func main() {}

0 commit comments

Comments
 (0)