Source file test/typeparam/recoverimp.dir/a.go

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package a
     6  
     7  import "fmt"
     8  
     9  func F[T any](a T) {
    10  	defer func() {
    11  		if x := recover(); x != nil {
    12  			fmt.Printf("panic: %v\n", x)
    13  		}
    14  	}()
    15  	panic(a)
    16  }
    17  

View as plain text