From 58ef9f4e3e771d915136e6343138c5a783dac53f Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 15 Apr 2024 16:27:28 +0100 Subject: [PATCH 1/6] Go: Run `resolve build-environment` in integration tests --- go/integration-tests-lib/go_integration_test.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/go/integration-tests-lib/go_integration_test.py b/go/integration-tests-lib/go_integration_test.py index 8e4cf6c102c1..2c26f513ba11 100644 --- a/go/integration-tests-lib/go_integration_test.py +++ b/go/integration-tests-lib/go_integration_test.py @@ -1,15 +1,22 @@ import os from create_database_utils import * from diagnostics_test_utils import * +from resolve_environment_utils import * -def go_integration_test(source = "src", db = "db", runFunction = runSuccessfully): +def go_integration_test(toolchain=None, source = "src", db = "db", runFunction = runSuccessfully): # Set up a GOPATH relative to this test's root directory; # we set os.environ instead of using extra_env because we # need it to be set for the call to "go clean -modcache" later goPath = os.path.join(os.path.abspath(os.getcwd()), ".go") os.environ['GOPATH'] = goPath + extra_env = None + + if toolchain != None: + extra_env = { 'GOTOOLCHAIN': toolchain } + try: + run_codeql_resolve_build_environment(lang="go", source=source, extra_env=extra_env) run_codeql_database_create([], lang="go", source=source, db=db, runFunction=runFunction) check_diagnostics() From eb2e5876375533304b394c1776ad9a131802fa36 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 15 May 2024 08:41:31 +0100 Subject: [PATCH 2/6] Go: Add `build-environment.expected` files --- .../go/bazel-sample-1/build-environment.expected | 5 +++++ .../go/bazel-sample-2/build-environment.expected | 5 +++++ .../build-environment.expected | 5 +++++ .../go-files-found-not-processed/build-environment.expected | 5 +++++ .../invalid-toolchain-version/build-environment.expected | 5 +++++ .../newer-go-version-needed/build-environment.expected | 5 +++++ .../diagnostics/no-go-files-found/build-environment.expected | 5 +++++ .../package-not-found-with-go-mod/build-environment.expected | 5 +++++ .../build-environment.expected | 5 +++++ .../unsupported-relative-path/build-environment.expected | 5 +++++ .../go-get-without-modules-sample/build-environment.expected | 5 +++++ .../go/go-mod-sample/build-environment.expected | 5 +++++ .../go/go-mod-without-version/build-environment.expected | 5 +++++ .../go/go-version-bump/build-environment.expected | 5 +++++ .../all-platforms/go/make-sample/build-environment.expected | 5 +++++ .../all-platforms/go/mixed-layout/build-environment.expected | 5 +++++ .../all-platforms/go/ninja-sample/build-environment.expected | 5 +++++ .../build-environment.expected | 5 +++++ .../go/single-go-mod-in-root/build-environment.expected | 5 +++++ .../go/single-go-mod-not-in-root/build-environment.expected | 5 +++++ .../go/single-go-work-not-in-root/build-environment.expected | 5 +++++ .../build-environment.expected | 5 +++++ .../build-environment.expected | 5 +++++ .../go/two-go-mods-not-nested/build-environment.expected | 5 +++++ .../go/two-go-mods-one-failure/build-environment.expected | 5 +++++ 25 files changed, 125 insertions(+) create mode 100644 go/ql/integration-tests/all-platforms/go/bazel-sample-1/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/bazel-sample-2/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/diagnostics/invalid-toolchain-version/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/go-mod-sample/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/go-mod-without-version/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/go-version-bump/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/make-sample/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/mixed-layout/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/ninja-sample/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/two-go-mods-one-failure/build-environment.expected diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-1/build-environment.expected b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-1/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/bazel-sample-2/build-environment.expected b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/bazel-sample-2/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/build-environment.expected b/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/build-constraints-exclude-all-go-files/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/build-environment.expected b/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/go-files-found-not-processed/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/invalid-toolchain-version/build-environment.expected b/go/ql/integration-tests/all-platforms/go/diagnostics/invalid-toolchain-version/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/invalid-toolchain-version/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/build-environment.expected b/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/newer-go-version-needed/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/build-environment.expected b/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/no-go-files-found/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/build-environment.expected b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-with-go-mod/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/build-environment.expected b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/package-not-found-without-go-mod/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/build-environment.expected b/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/diagnostics/unsupported-relative-path/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/build-environment.expected b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/go-get-without-modules-sample/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-sample/build-environment.expected b/go/ql/integration-tests/all-platforms/go/go-mod-sample/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/go-mod-sample/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/go-mod-without-version/build-environment.expected b/go/ql/integration-tests/all-platforms/go/go-mod-without-version/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/go-mod-without-version/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/go-version-bump/build-environment.expected b/go/ql/integration-tests/all-platforms/go/go-version-bump/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/go-version-bump/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/make-sample/build-environment.expected b/go/ql/integration-tests/all-platforms/go/make-sample/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/make-sample/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/mixed-layout/build-environment.expected b/go/ql/integration-tests/all-platforms/go/mixed-layout/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/mixed-layout/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/ninja-sample/build-environment.expected b/go/ql/integration-tests/all-platforms/go/ninja-sample/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/ninja-sample/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/build-environment.expected b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-and-go-files-not-under-it/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/build-environment.expected b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-in-root/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/build-environment.expected b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/single-go-mod-not-in-root/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/build-environment.expected b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/single-go-work-not-in-root/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/build-environment.expected b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-none-in-root/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/build-environment.expected b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-nested-one-in-root/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/build-environment.expected b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-not-nested/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/two-go-mods-one-failure/build-environment.expected b/go/ql/integration-tests/all-platforms/go/two-go-mods-one-failure/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/two-go-mods-one-failure/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} From 7cf61ffb187015e839dea9e14a238c73585a4e8d Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 17 Apr 2024 15:35:22 +0100 Subject: [PATCH 3/6] Go: Add integration test for `resolve build-environment` --- .../resolve-build-environment/build-environment.expected | 7 +++++++ .../all-platforms/go/resolve-build-environment/src/go.mod | 3 +++ .../all-platforms/go/resolve-build-environment/src/main.go | 3 +++ .../all-platforms/go/resolve-build-environment/test.py | 3 +++ 4 files changed, 16 insertions(+) create mode 100644 go/ql/integration-tests/all-platforms/go/resolve-build-environment/build-environment.expected create mode 100644 go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/go.mod create mode 100644 go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/main.go create mode 100644 go/ql/integration-tests/all-platforms/go/resolve-build-environment/test.py diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/build-environment.expected b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/build-environment.expected new file mode 100644 index 000000000000..0ef0c180822c --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/build-environment.expected @@ -0,0 +1,7 @@ +{ + "configuration" : { + "go" : { + "version" : "1.22" + } + } +} diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/go.mod b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/go.mod new file mode 100644 index 000000000000..881685330d07 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/go.mod @@ -0,0 +1,3 @@ +go 1.22 + +module main diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/main.go b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/main.go new file mode 100644 index 000000000000..37148d1f7af4 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/main.go @@ -0,0 +1,3 @@ +package main + +func Main() {} diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/test.py b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/test.py new file mode 100644 index 000000000000..87741c370883 --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/test.py @@ -0,0 +1,3 @@ +from go_integration_test import * + +go_integration_test(toolchain="go1.21.0") From 7e10f212cde89d99190d295b9264266dd11471df Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 10 May 2024 15:12:11 +0100 Subject: [PATCH 4/6] Go: Move `resolve build-environment` test into subdirectory --- .../{ => newer-go-needed}/build-environment.expected | 0 .../go/resolve-build-environment/{ => newer-go-needed}/src/go.mod | 0 .../resolve-build-environment/{ => newer-go-needed}/src/main.go | 0 .../go/resolve-build-environment/{ => newer-go-needed}/test.py | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename go/ql/integration-tests/all-platforms/go/resolve-build-environment/{ => newer-go-needed}/build-environment.expected (100%) rename go/ql/integration-tests/all-platforms/go/resolve-build-environment/{ => newer-go-needed}/src/go.mod (100%) rename go/ql/integration-tests/all-platforms/go/resolve-build-environment/{ => newer-go-needed}/src/main.go (100%) rename go/ql/integration-tests/all-platforms/go/resolve-build-environment/{ => newer-go-needed}/test.py (100%) diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/build-environment.expected b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/build-environment.expected similarity index 100% rename from go/ql/integration-tests/all-platforms/go/resolve-build-environment/build-environment.expected rename to go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/build-environment.expected diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/go.mod b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/src/go.mod similarity index 100% rename from go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/go.mod rename to go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/src/go.mod diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/main.go b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/src/main.go similarity index 100% rename from go/ql/integration-tests/all-platforms/go/resolve-build-environment/src/main.go rename to go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/src/main.go diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/test.py b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/test.py similarity index 100% rename from go/ql/integration-tests/all-platforms/go/resolve-build-environment/test.py rename to go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/test.py From b44ad2d39f1f96efb9070d3fa3a1068cb1095e0c Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 15 May 2024 09:33:44 +0100 Subject: [PATCH 5/6] Go: Add missing `diagnostics.expected` file --- .../newer-go-needed/diagnostics.expected | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/diagnostics.expected diff --git a/go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/diagnostics.expected b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/diagnostics.expected new file mode 100644 index 000000000000..b64c1397938d --- /dev/null +++ b/go/ql/integration-tests/all-platforms/go/resolve-build-environment/newer-go-needed/diagnostics.expected @@ -0,0 +1,31 @@ +{ + "location": { + "file": "go.mod" + }, + "markdownMessage": "As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).\n\n`1.22` in `go.mod` does not match this syntax and there is no additional `toolchain` directive, which may cause some `go` commands to fail.", + "severity": "warning", + "source": { + "extractorName": "go", + "id": "go/autobuilder/invalid-go-toolchain-version", + "name": "Invalid Go toolchain version" + }, + "visibility": { + "cliSummaryTable": true, + "statusPage": true, + "telemetry": true + } +} +{ + "markdownMessage": "A single `go.mod` file was found.\n\n`go.mod`", + "severity": "note", + "source": { + "extractorName": "go", + "id": "go/autobuilder/single-root-go-mod-found", + "name": "A single `go.mod` file was found in the root" + }, + "visibility": { + "cliSummaryTable": false, + "statusPage": false, + "telemetry": true + } +} From 28c8611f93c18502774ab630366eae985ffa52e8 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 15 May 2024 09:34:28 +0100 Subject: [PATCH 6/6] Go: Add `build-environment.expected` for linux-only tests --- .../linux-only/go/dep-sample/build-environment.expected | 5 +++++ .../linux-only/go/glide-sample/build-environment.expected | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 go/ql/integration-tests/linux-only/go/dep-sample/build-environment.expected create mode 100644 go/ql/integration-tests/linux-only/go/glide-sample/build-environment.expected diff --git a/go/ql/integration-tests/linux-only/go/dep-sample/build-environment.expected b/go/ql/integration-tests/linux-only/go/dep-sample/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/linux-only/go/dep-sample/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +} diff --git a/go/ql/integration-tests/linux-only/go/glide-sample/build-environment.expected b/go/ql/integration-tests/linux-only/go/glide-sample/build-environment.expected new file mode 100644 index 000000000000..0b225ce00857 --- /dev/null +++ b/go/ql/integration-tests/linux-only/go/glide-sample/build-environment.expected @@ -0,0 +1,5 @@ +{ + "configuration" : { + "go" : { } + } +}