govulncheck: fix version information

This commit is contained in:
Sandro Jäckel 2023-11-06 15:33:09 +01:00
parent 0dbb76220d
commit b66dea4711
No known key found for this signature in database
GPG key ID: 3AF5A43A3EECC2E5
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
}