Skip to content

Commit

Permalink
chore: add build time
Browse files Browse the repository at this point in the history
  • Loading branch information
Subilan committed Jul 31, 2024
1 parent 490a591 commit 0353859
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
env GOOS=linux GOARCH=amd64 go build -o lab
env GOOS=linux GOARCH=amd64 go build -o lab -ldflags='-X LastBuiltAt="date +%Y-%m-%d_%H:%M:%S"'
5 changes: 4 additions & 1 deletion common/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import (
"time"
)

var LastBuiltAt string

type Router struct {
Port int
Router *gin.Engine
Expand Down Expand Up @@ -46,7 +48,7 @@ func handleNotFound(ctx *gin.Context) {
}

func handleVersion(ctx *gin.Context) {
ctx.String(200, "tisea @ "+utils.GlobalConfig.Version)
ctx.String(200, "tisea @ "+utils.GlobalConfig.Version+"\nbuild"+LastBuiltAt)
}

func HandleDonators(ctx *gin.Context) *errors.CustomErr {
Expand All @@ -73,6 +75,7 @@ func handleUnauth(ctx *gin.Context) {

func (r *Router) Init() {
log.Println("Using Gin " + gin.Version)
log.Println("Built at " + LastBuiltAt)

r.Router = gin.Default()

Expand Down

0 comments on commit 0353859

Please sign in to comment.