Skip to content

Commit

Permalink
chore: update go templates (aws#21728)
Browse files Browse the repository at this point in the history
These changes were brought up in a [review of the Go workshop](aws-samples/aws-cdk-intro-workshop#636)

- update Go version
- close jsii process
- remove unneeded `assertions` alias

----

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
peterwoodworth authored and josephedward committed Aug 30, 2022
1 parent c83f043 commit 7ebafbf
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/aws-cdk/lib/init-templates/app/go/%name%.template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
// )

Expand Down
2 changes: 1 addition & 1 deletion packages/aws-cdk/lib/init-templates/app/go/go.template.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module %name%

go 1.16
go 1.18

require (
github.com/aws/aws-cdk-go/awscdk/v2 v%cdk-version%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module %name%

go 1.16
go 1.18

require (
github.com/aws/aws-cdk-go/awscdk/v2 v%cdk-version%
Expand Down

0 comments on commit 7ebafbf

Please sign in to comment.