govulncheck: fix version information
This commit is contained in:
parent
0dbb76220d
commit
b66dea4711
2 changed files with 24 additions and 0 deletions
|
@ -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 = [
|
||||
|
|
15
pkgs/tools/security/govulncheck/version.patch
Normal file
15
pkgs/tools/security/govulncheck/version.patch
Normal 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
|
||||
}
|
||||
|
Loading…
Reference in a new issue