Skip to content

Commit

Permalink
fix(go): generated code runtime dependency version (#2399)
Browse files Browse the repository at this point in the history
Fixes the version number of the jsii runtime module dependency in
generated go.mod files to not include the build number. This does it
the same way that python and dotnet are.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
MrArnoldPalmer and mergify[bot] authored Jan 6, 2021
1 parent fcf3ba3 commit f1a06e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/jsii-pacmak/lib/targets/go/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,13 @@ export class RootPackage extends Package {
code.line(`go ${GO_VERSION}`);
code.line();
code.open('require (');
code.line(`${JSII_RT_MODULE_NAME} v${this.assembly.jsiiVersion}`);
// Strip " (build abcdef)" from the jsii version
code.line(
`${JSII_RT_MODULE_NAME} v${this.assembly.jsiiVersion.replace(
/ .*$/,
'',
)}`,
);
for (const dep of this.packageDependencies) {
code.line(`${dep.goModuleName} v${dep.version}`);
}
Expand Down

0 comments on commit f1a06e5

Please sign in to comment.