github.com/opentofu/opentofu@v1.7.1/internal/encryption/method/aesgcm/panic_test.go (about)

     1  package aesgcm
     2  
     3  import (
     4  	"fmt"
     5  )
     6  
     7  func Example_handlePanic() {
     8  	_, err := handlePanic(func() ([]byte, error) {
     9  		panic("Hello world!")
    10  	})
    11  	fmt.Printf("%v", err)
    12  	// Output: Hello world!
    13  }