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}`); }