-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(go): require go 1.16, use native embed #2603
Conversation
Note - this has a bootstrap paradox for the CodeBuild PR validation, as the |
Instead of generating code to build byte slices with the embedded assets, upgraded the baseline go requirement to go 1.16, and use the new native embed feature released as part of this go release. This includes the update to `jsii/superhain` to the correct go release, updates to the `.github/workflows/main.yml` workflow to ensure the correct go version is installed in PR validation builds, and the changes in `jsii-pacmak` and `@jsii/go-runtime` to leverage the feature. See: https://pkg.go.dev/embed
b40c5c9
to
a51b06c
Compare
@@ -344,7 +348,9 @@ export class RootPackage extends Package { | |||
importGoModules(code, toImport); | |||
|
|||
code.line(); | |||
code.line('var once sync.Once'); | |||
code.line(`//go:embed ${tarballName(this.assembly)}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow, go:embed is weird
# Conflicts: # packages/jsii-pacmak/lib/targets/go.ts # packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.ts.snap
I have manually resolved the bootstrap paradox at this stage (I think) |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Instead of generating code to build byte slices with the embedded
assets, upgraded the baseline go requirement to go 1.16, and use the new
native embed feature released as part of this go release.
This includes the update to
jsii/superhain
to the correct go release,updates to the
.github/workflows/main.yml
workflow to ensure thecorrect go version is installed in PR validation builds, and the changes
in
jsii-pacmak
and@jsii/go-runtime
to leverage the feature.This makes the code easier to deal with by IDEs (the byte slices were
otherwise very large and caused IDEs to occasionally choke on them),
and removes the risk we make a mistake in generating the slices. It
also makes the generated code easier to troubleshoot, as the tarball
is present as-is, and can be inspected without additional hoop jumping.
See: https://pkg.go.dev/embed
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.