-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cf3dd12
commit 5ddb711
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package version | ||
|
||
import ( | ||
"fmt" | ||
"runtime" | ||
"time" | ||
) | ||
|
||
var ( | ||
NAME = "Eru-Core" | ||
VERSION = "1.0.0" | ||
REVISION = "HEAD" | ||
) | ||
|
||
func VersionString() string { | ||
build := time.Now() | ||
// 暂时隐藏吧, 也不知道按啥version发布的好 | ||
// version := fmt.Sprintf("Version: %s\n", VERSION) | ||
version := fmt.Sprintf("Git hash: %s\n", REVISION) | ||
version += fmt.Sprintf("Built: %s\n", build.Format(time.RFC1123Z)) | ||
version += fmt.Sprintf("Golang version: %s\n", runtime.Version()) | ||
version += fmt.Sprintf("OS/Arch: %s/%s\n", runtime.GOOS, runtime.GOARCH) | ||
return version | ||
} |