Files
nixpkgs/pkgs/by-name/ga/garble/0001-Add-version-info.patch
2026-04-01 08:38:38 -07:00

22 lines
667 B
Diff

--- a/main.go
+++ b/main.go
@@ -370,6 +370,7 @@
mod = mod.Replace
}
+ mod.Version = "@version@"
fmt.Printf("%s %s\n\n", mod.Path, mod.Version)
fmt.Printf("Build settings:\n")
for _, setting := range info.Settings {
--- a/testdata/script/help.txtar
+++ b/testdata/script/help.txtar
@@ -88,7 +88,7 @@
# Test the version command. Note that test binaries exclude VCS build info,
# and we reuse the test binary for garble itself, so that's missing.
exec garble version
-stdout -count=1 'mvdan.cc/garble \(devel\)'
+stdout -count=1 'mvdan.cc/garble @version@'
stdout -count=1 'Build settings'
stdout -count=3 '-compiler|GOOS|GOARCH'
! stdout 'vcs'