You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Description
Set the use of the MVS algorithm default to `true` as it is the default
behaviour in Go
* Fix how environment variables are parsed in Windows
* Fix NPE when processing dependencies
* The last dependency was being ignored
**Related issue (if any):**
fixes#174fixes#192
## Checklist
- [x] I have followed this repository's contributing guidelines.
- [x] I will adhere to the project's code of conduct.
---------
Signed-off-by: Ruben Romero Montes <[email protected]>
By default, Golang dependency resolution follows the [Minimal Version Selection (MVS) Algorithm](https://go.dev/ref/mod#minimal-version-selection).
510
+
This means that when analyzing a project, only the module versions that would actually be included in the final executable are considered.
513
511
512
+
For example, if your `go.mod` file declares two modules, `a` and `b`, and both depend on the same package `c` (same major version `v1`) but with different minor versions:
514
513
515
-
Then both of these packages will be entered to the generated sbom and will be included in analysis returned to client.
516
-
In golang, in an actual build of an application into an actual application executable binary, only one of the minor versions will be included in the executable, as only packages with same name but different major versions considered different packages ,
517
-
hence can co-exist together in the application executable.
Go ecosystem knows how to select one minor version among all the minor versions of the same major version of a given package, using the [MVS Algorithm](https://go.dev/ref/mod#minimal-version-selection).
520
-
521
-
In order to enable this behavior, that only shows in analysis modules versions that are actually built into the application executable, please set
522
-
system property/environment variable - `EXHORT_GO_MVS_LOGIC_ENABLED=true`(Default is false)
517
+
Only one of these versions — the minimal version selected by MVS — will be included in the generated SBOM and analysis results.
518
+
This mirrors the behavior of a real Go build, where only one minor version of a given major version can be present in the executable (since Go treats packages with the same name and major version as identical).
523
519
520
+
The MVS-based resolution is **enabled by default**.
521
+
If you want to disable this behavior and instead include **all transitive module versions** (as listed in `go.mod` dependencies), set the system property or environment variable:
0 commit comments