mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
593 B
30 lines
593 B
2 years ago
|
// Copyright 2022 ROC. All rights reserved.
|
||
|
// Use of this source code is governed by a MIT style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
2 years ago
|
package version
|
||
3 years ago
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
var version, commitID, buildDate string
|
||
|
|
||
|
type BuildInfo struct {
|
||
2 years ago
|
Version string `json:"version"`
|
||
|
Sum string `json:"sum"`
|
||
|
BuildDate string `json:"build_date"`
|
||
3 years ago
|
}
|
||
|
|
||
|
func VersionInfo() string {
|
||
|
return fmt.Sprintf("paopao %s (build:%s %s)", version, commitID, buildDate)
|
||
|
}
|
||
|
|
||
|
func ReadBuildInfo() *BuildInfo {
|
||
|
return &BuildInfo{
|
||
|
Version: version,
|
||
|
Sum: commitID,
|
||
|
BuildDate: buildDate,
|
||
|
}
|
||
|
}
|