Go: Update identify-environment JSON format

The spec changed after this was implemented and merged
This commit is contained in:
Michael B. Gale
2023-05-18 20:21:12 +01:00
parent af803c8886
commit 631ba6584d

View File

@@ -44,7 +44,7 @@ Build behavior:
to 'false' disables the GOPATH set-up, CODEQL_EXTRACTOR_GO_BUILD_COMMAND (or alternatively
LGTM_INDEX_BUILD_COMMAND), can be set to a newline-separated list of commands to run in order to
install dependencies, and LGTM_INDEX_IMPORT_PATH can be used to override the package import path,
which is otherwise inferred from the SEMMLE_REPO_URL or GITHUB_REPOSITORY environment variables.
which is otherwise inferred from the SEMMLE_REPO_URL or GITHUB_REPOSITORY environment variables.
In resource-constrained environments, the environment variable CODEQL_EXTRACTOR_GO_MAX_GOROUTINES
(or its legacy alias SEMMLE_MAX_GOROUTINES) can be used to limit the number of parallel goroutines
@@ -931,9 +931,9 @@ func getVersionToInstall(v versionInfo) (msg, version string) {
func outputEnvironmentJson(version string) {
var content string
if version == "" {
content = `{ "include": [] }`
content = `{ "go": {} }`
} else {
content = `{ "include": [ { "go": { "version": "` + version + `" } } ] }`
content = `{ "go": { "version": "` + version + `" } }`
}
_, err := fmt.Fprint(os.Stdout, content)