Skip to content

Commit d4f9922

Browse files
committedFeb 12, 2025··
Read BuildInfo from runtime/debug instead of buildversion
1 parent e8fd57e commit d4f9922

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎main.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"io"
88
"log"
99
"os"
10+
"runtime/debug"
1011

11-
"github.com/mfridman/buildversion"
1212
"github.com/mfridman/tparse/internal/app"
1313
"github.com/mfridman/tparse/internal/utils"
1414
"github.com/mfridman/tparse/parse"
@@ -77,7 +77,10 @@ func main() {
7777
flag.Parse()
7878

7979
if *vPtr || *versionPtr {
80-
fmt.Fprintf(os.Stdout, "tparse version: %s\n", buildversion.New(version))
80+
if info, ok := debug.ReadBuildInfo(); ok {
81+
version = info.Main.Version
82+
}
83+
fmt.Fprintf(os.Stdout, "tparse version: %s\n", version)
8184
return
8285
}
8386
if *hPtr || *helpPtr {

0 commit comments

Comments
 (0)
Please sign in to comment.