aquasecurity / trivy

Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more
https://aquasecurity.github.io/trivy
Apache License 2.0
22.31k stars 2.2k forks source link

feat(golang): support toolchain directive #7111

Open knqyf263 opened 2 weeks ago

knqyf263 commented 2 weeks ago

Description

Currently, when scanning Go binaries, the stdlib version is identified from the go version -m result, but not when scanning go.mod. With the introduction of Go Toolchains, the version of Go used in a project can now be strictly specified, so we should use this version as stdlib.

module github.com/aquasecurity/trivy

go 1.22.0

toolchain go1.22.4

In this example, we take 1.22.4 as the stdlib version.