From 9d44a3ade2db29b2309352be329b76318cca07fd Mon Sep 17 00:00:00 2001 From: Mitchell Valine Date: Mon, 4 Jan 2021 15:06:51 -0800 Subject: [PATCH] fix(go): generated code runtime dependency version 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. --- packages/jsii-pacmak/lib/targets/go/package.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/jsii-pacmak/lib/targets/go/package.ts b/packages/jsii-pacmak/lib/targets/go/package.ts index 7ae2127621..300717d0e5 100644 --- a/packages/jsii-pacmak/lib/targets/go/package.ts +++ b/packages/jsii-pacmak/lib/targets/go/package.ts @@ -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}`); }