Skip to content

Commit a730c58

Browse files
authored
Merge pull request #3 from tigrisdata/Xe/version-stamping
chore: use Go version stamping
2 parents 81516cf + e11c4f4 commit a730c58

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

cmd/objgitd/main.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ import (
2020
"github.com/gliderlabs/ssh"
2121
"github.com/go-git/go-git/v6/plumbing/transport"
2222
"github.com/prometheus/client_golang/prometheus/promhttp"
23-
"github.com/tigrisdata/storage-go"
24-
"golang.org/x/sync/errgroup"
23+
"github.com/tigrisdata/objgit"
2524
"github.com/tigrisdata/objgit/internal"
2625
"github.com/tigrisdata/objgit/internal/auth"
2726
"github.com/tigrisdata/objgit/internal/metrics"
2827
"github.com/tigrisdata/objgit/internal/s3fs"
28+
"github.com/tigrisdata/storage-go"
29+
"golang.org/x/sync/errgroup"
2930

3031
_ "github.com/joho/godotenv/autoload"
3132
)
@@ -141,6 +142,7 @@ func main() {
141142
}
142143

143144
slog.Info("objgitd listening",
145+
"version", objgit.Version,
144146
"git_bind", *gitBind,
145147
"http_bind", *httpBind,
146148
"ssh_bind", *sshBind,

objgit.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package objgit
2+
3+
import "runtime/debug"
4+
5+
func init() {
6+
bi, ok := debug.ReadBuildInfo()
7+
if !ok {
8+
return
9+
}
10+
11+
Version = bi.Main.Version
12+
}
13+
14+
var Version = "(devel)"

0 commit comments

Comments
 (0)