blob: ec4e0a18ebec8391787ed9d05224527d7c92d10e [file] [log] [blame]
Dan Willemsenf3f2eb62018-08-28 11:28:58 -07001// run
2
3// Copyright 2018 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Check that calling a nil func causes a proper panic.
8
9package main
10
11func main() {
12 defer func() {
13 err := recover()
14 if err == nil {
15 panic("panic expected")
16 }
17 }()
18
19 var f func()
20 f()
21}