-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(go): adding new compliance tests (#2655)
Additionally, correct code generation for variadic methods and constructors, as previously the variadicity was simply ignored. Partially implements #2634
- Loading branch information
1 parent
87df2df
commit a830834
Showing
25 changed files
with
1,338 additions
and
569 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { runCommand } from '@jsii/go-runtime/build-tools/_constants'; | ||
import { spawnSync } from 'child_process'; | ||
import { constants } from 'os'; | ||
import { join } from 'path'; | ||
import { argv, exit } from 'process'; | ||
|
||
if (argv.length < 3) { | ||
console.error(`Not enough arguments: ${argv[0]} ${argv[1]} <cmd> [args]`); | ||
exit(1); | ||
} | ||
|
||
const [, , cmd, ...args] = argv; | ||
|
||
const result = spawnSync('go', ['env', 'GOPATH'], { | ||
stdio: ['inherit', 'pipe', 'inherit'], | ||
}); | ||
|
||
if (result.error) { | ||
console.error('"go env GOPATH" failed:', result.error); | ||
exit(-1); | ||
} | ||
|
||
if (result.status !== 0) { | ||
console.error('"go env GOPATH" failed:', result.status ?? result.signal); | ||
exit( | ||
result.status ?? 128 + constants.signals[result.signal as NodeJS.Signals], | ||
); | ||
} | ||
|
||
const gopath = result.stdout.toString('utf8').trim(); | ||
runCommand(join(gopath, 'bin', cmd), args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.