Skip to content

Commit

Permalink
feat(jsii-pacmak): allow disabling go build conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielMSchmidt committed Jul 26, 2023
1 parent ef6e5b1 commit d0f30cc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/jsii-pacmak/lib/targets/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ export class Golang extends Target {
);
return Promise.reject(e);
}
await go('build', ['-modfile', localGoMod.path, './...'], { cwd: pkgDir });

if (process.env.JSII_GO_DISABLE_BUILD !== '1') {
// This step is taken to ensure that the generated code is compilable
await go('build', ['-modfile', localGoMod.path, './...'], {
cwd: pkgDir,
});
}

// delete local.go.mod and local.go.sum from the output directory so it doesn't get published
const localGoSum = `${path.basename(localGoMod.path, '.mod')}.sum`;
Expand Down

0 comments on commit d0f30cc

Please sign in to comment.