Skip to content

Commit f2ef8dd

Browse files
committed
fix: handle error on termination
1 parent dc34b5a commit f2ef8dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/localstack/examples_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ func ExampleRunContainer_UsingLambdas() {
153153
if err != nil {
154154
panic(err)
155155
}
156-
defer container.Terminate(ctx)
156+
defer func() {
157+
err := container.Terminate(ctx)
158+
if err != nil {
159+
panic(err)
160+
}
161+
}()
157162

158163
// the three commands below are doing the following:
159164
// 1. create a lambda function

0 commit comments

Comments
 (0)