diff --git a/build.sh b/build.sh index bd4bded..bff1827 100644 --- a/build.sh +++ b/build.sh @@ -1 +1 @@ -env GOOS=linux GOARCH=amd64 go build -o lab \ No newline at end of file +env GOOS=linux GOARCH=amd64 go build -o lab -ldflags='-X LastBuiltAt="date +%Y-%m-%d_%H:%M:%S"' \ No newline at end of file diff --git a/common/router.go b/common/router.go index cd27ae9..074e6de 100644 --- a/common/router.go +++ b/common/router.go @@ -16,6 +16,8 @@ import ( "time" ) +var LastBuiltAt string + type Router struct { Port int Router *gin.Engine @@ -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 { @@ -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()