1 From e46a41faac008ede4acbeb18db5b3076eb206de5 Mon Sep 17 00:00:00 2001
2 From: wxt <3264117476@qq.com>
3 Date: Sun, 3 Nov 2024 15:11:49 +0800
4 Subject: [PATCH] Add version info
8 testdata/script/help.txtar | 2 +-
9 2 files changed, 2 insertions(+), 1 deletion(-)
11 diff --git a/main.go b/main.go
12 index 0de5a2f..1c830b1 100644
15 @@ -362,6 +362,7 @@ func mainErr(args []string) error {
16 // manually construct something like a pseudo-version.
17 // TODO: remove when this code is dead, hopefully in Go 1.22.
18 if mod.Version == "(devel)" {
19 + mod.Version = "@version@"
21 var vcsRevision string
22 for _, setting := range info.Settings {
23 diff --git a/testdata/script/help.txtar b/testdata/script/help.txtar
24 index 8f25260..859f492 100644
25 --- a/testdata/script/help.txtar
26 +++ b/testdata/script/help.txtar
27 @@ -91,7 +91,7 @@ stderr 'directory not found'
28 # and to be able to use static VCS info, use an environment variable.
29 # First, test without the information, and then with it.
31 -stdout -count=1 'mvdan.cc/garble \(devel\)'
32 +stdout -count=1 'mvdan.cc/garble @version@'
33 stdout -count=1 'Build settings'
34 stdout -count=3 '-compiler|GOOS|GOARCH'