diff --git a/packages/aws-cdk/lib/init-templates/app/go/%name%.template.go b/packages/aws-cdk/lib/init-templates/app/go/%name%.template.go index a2ab8b5d8f8fd..1cbe6d66b615c 100644 --- a/packages/aws-cdk/lib/init-templates/app/go/%name%.template.go +++ b/packages/aws-cdk/lib/init-templates/app/go/%name%.template.go @@ -29,6 +29,8 @@ func New%name.PascalCased%Stack(scope constructs.Construct, id string, props *%n } func main() { + defer jsii.Close() + app := awscdk.NewApp(nil) New%name.PascalCased%Stack(app, "%name.PascalCased%Stack", &%name.PascalCased%StackProps{ diff --git a/packages/aws-cdk/lib/init-templates/app/go/%name%_test.template.go b/packages/aws-cdk/lib/init-templates/app/go/%name%_test.template.go index 251be839ed3f0..00ea26012b3d1 100644 --- a/packages/aws-cdk/lib/init-templates/app/go/%name%_test.template.go +++ b/packages/aws-cdk/lib/init-templates/app/go/%name%_test.template.go @@ -4,7 +4,7 @@ package main // "testing" // "github.com/aws/aws-cdk-go/awscdk/v2" -// assertions "github.com/aws/aws-cdk-go/awscdk/v2/assertions" +// "github.com/aws/aws-cdk-go/awscdk/v2/assertions" // "github.com/aws/jsii-runtime-go" // ) diff --git a/packages/aws-cdk/lib/init-templates/app/go/go.template.mod b/packages/aws-cdk/lib/init-templates/app/go/go.template.mod index 3b61360cb8e15..a6efe391ef9fc 100644 --- a/packages/aws-cdk/lib/init-templates/app/go/go.template.mod +++ b/packages/aws-cdk/lib/init-templates/app/go/go.template.mod @@ -1,6 +1,6 @@ module %name% -go 1.16 +go 1.18 require ( github.com/aws/aws-cdk-go/awscdk/v2 v%cdk-version% diff --git a/packages/aws-cdk/lib/init-templates/sample-app/go/%name%.template.go b/packages/aws-cdk/lib/init-templates/sample-app/go/%name%.template.go index 1ae8249703373..a45e420483da9 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/go/%name%.template.go +++ b/packages/aws-cdk/lib/init-templates/sample-app/go/%name%.template.go @@ -32,6 +32,8 @@ func New%name.PascalCased%Stack(scope constructs.Construct, id string, props *%n } func main() { + defer jsii.Close() + app := awscdk.NewApp(nil) New%name.PascalCased%Stack(app, "%name.PascalCased%Stack", &%name.PascalCased%StackProps{ diff --git a/packages/aws-cdk/lib/init-templates/sample-app/go/%name%_test.template.go b/packages/aws-cdk/lib/init-templates/sample-app/go/%name%_test.template.go index 606ccc499d9ab..56181ebe4b377 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/go/%name%_test.template.go +++ b/packages/aws-cdk/lib/init-templates/sample-app/go/%name%_test.template.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/aws/aws-cdk-go/awscdk/v2" - assertions "github.com/aws/aws-cdk-go/awscdk/v2/assertions" + "github.com/aws/aws-cdk-go/awscdk/v2/assertions" "github.com/aws/jsii-runtime-go" ) diff --git a/packages/aws-cdk/lib/init-templates/sample-app/go/go.template.mod b/packages/aws-cdk/lib/init-templates/sample-app/go/go.template.mod index 3b61360cb8e15..a6efe391ef9fc 100644 --- a/packages/aws-cdk/lib/init-templates/sample-app/go/go.template.mod +++ b/packages/aws-cdk/lib/init-templates/sample-app/go/go.template.mod @@ -1,6 +1,6 @@ module %name% -go 1.16 +go 1.18 require ( github.com/aws/aws-cdk-go/awscdk/v2 v%cdk-version%