chore(binary): support LDFLAGS by goreleaser
fix https://github.com/appleboy/gorush/issues/713
This commit is contained in:
@@ -7,13 +7,21 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
var version string
|
||||
var (
|
||||
version string
|
||||
commit string
|
||||
)
|
||||
|
||||
// SetVersion for setup version string.
|
||||
func SetVersion(ver string) {
|
||||
version = ver
|
||||
}
|
||||
|
||||
// SetCommit for setup commit string.
|
||||
func SetCommit(ver string) {
|
||||
commit = ver
|
||||
}
|
||||
|
||||
// GetVersion for get current version.
|
||||
func GetVersion() string {
|
||||
return version
|
||||
@@ -21,8 +29,9 @@ func GetVersion() string {
|
||||
|
||||
// PrintGoRushVersion provide print server engine
|
||||
func PrintGoRushVersion() {
|
||||
fmt.Printf(`GoRush %s, Compiler: %s %s, Copyright (C) 2019 Bo-Yi Wu, Inc.`,
|
||||
fmt.Printf(`GoRush %s, Commit: %s, Compiler: %s %s, Copyright (C) 2023 Bo-Yi Wu, Inc.`,
|
||||
version,
|
||||
commit,
|
||||
runtime.Compiler,
|
||||
runtime.Version())
|
||||
fmt.Println()
|
||||
|
||||
Reference in New Issue
Block a user