Merge pull request #265863 from SuperSandro2000/govulncheck-version

govulncheck: fix version information
This commit is contained in:
Mario Rodas 2023-11-26 16:48:40 -05:00 committed by GitHub
commit 9fd3c98dc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 0 deletions

View File

@ -1,6 +1,7 @@
{ lib
, buildGoModule
, fetchFromGitHub
, substituteAll
}:
buildGoModule rec {
@ -14,6 +15,14 @@ buildGoModule rec {
hash = "sha256-cewQ03dK/k3mXevE09M01Yox/3ZWP6IrG0H4QsZMzy8=";
};
patches = [
# patch in version information
(substituteAll {
src = ./version.patch;
inherit version;
})
];
vendorHash = "sha256-r9XshbgVA5rppJF46SFYPad344ZHMLWTHTnL6vbIFH8=";
subPackages = [

View File

@ -0,0 +1,15 @@
diff --git a/internal/scan/run.go b/internal/scan/run.go
index fa7fe37..216ca43 100644
--- a/internal/scan/run.go
+++ b/internal/scan/run.go
@@ -99,8 +99,8 @@ func scannerVersion(cfg *config, bi *debug.BuildInfo) {
if bi.Path != "" {
cfg.ScannerName = path.Base(bi.Path)
}
- if bi.Main.Version != "" && bi.Main.Version != "(devel)" {
- cfg.ScannerVersion = bi.Main.Version
+ if true {
+ cfg.ScannerVersion = "@version@"
return
}