2020-10-23 03:54:50 +13:00
|
|
|
package neko
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
|
|
|
)
|
|
|
|
|
|
|
|
const Header = `&34
|
|
|
|
_ __ __
|
|
|
|
/ | / /__ / /______ \ /\
|
|
|
|
/ |/ / _ \/ //_/ __ \ ) ( ')
|
|
|
|
/ /| / __/ ,< / /_/ / ( / )
|
|
|
|
/_/ |_/\___/_/|_|\____/ \(__)|
|
2021-01-31 11:55:50 +13:00
|
|
|
&1&37 nurdism/m1k1o &33%s v%s&0
|
2020-10-23 03:54:50 +13:00
|
|
|
`
|
|
|
|
|
|
|
|
var (
|
|
|
|
//
|
|
|
|
buildDate = "dev"
|
|
|
|
//
|
|
|
|
gitCommit = "dev"
|
|
|
|
//
|
|
|
|
gitBranch = "dev"
|
|
|
|
|
2021-03-16 22:16:57 +13:00
|
|
|
// Major version when you make incompatible API changes.
|
2020-10-23 03:54:50 +13:00
|
|
|
major = "dev"
|
2021-03-16 22:16:57 +13:00
|
|
|
// Minor version when you add functionality in a backwards-compatible manner.
|
2020-10-23 03:54:50 +13:00
|
|
|
minor = "dev"
|
2021-03-16 22:16:57 +13:00
|
|
|
// Patch version when you make backwards-compatible bug fixes.
|
2020-10-23 03:54:50 +13:00
|
|
|
patch = "dev"
|
|
|
|
)
|
|
|
|
|
2022-01-17 08:35:57 +13:00
|
|
|
var Version = &version{
|
|
|
|
Major: major,
|
|
|
|
Minor: minor,
|
|
|
|
Patch: patch,
|
|
|
|
GitCommit: gitCommit,
|
|
|
|
GitBranch: gitBranch,
|
|
|
|
BuildDate: buildDate,
|
|
|
|
GoVersion: runtime.Version(),
|
|
|
|
Compiler: runtime.Compiler,
|
|
|
|
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
|
2020-10-23 03:54:50 +13:00
|
|
|
}
|
|
|
|
|
2022-01-17 08:35:57 +13:00
|
|
|
type version struct {
|
2020-10-23 03:54:50 +13:00
|
|
|
Major string
|
|
|
|
Minor string
|
|
|
|
Patch string
|
|
|
|
GitCommit string
|
|
|
|
GitBranch string
|
|
|
|
BuildDate string
|
|
|
|
GoVersion string
|
|
|
|
Compiler string
|
|
|
|
Platform string
|
|
|
|
}
|
|
|
|
|
2022-01-17 08:35:57 +13:00
|
|
|
func (i *version) String() string {
|
2020-10-23 03:54:50 +13:00
|
|
|
return fmt.Sprintf("%s.%s.%s %s", i.Major, i.Minor, i.Patch, i.GitCommit)
|
|
|
|
}
|
|
|
|
|
2022-01-17 08:35:57 +13:00
|
|
|
func (i *version) Details() string {
|
2020-10-23 03:54:50 +13:00
|
|
|
return fmt.Sprintf(
|
|
|
|
"%s\n%s\n%s\n%s\n%s\n%s\n%s\n",
|
|
|
|
fmt.Sprintf("Version %s.%s.%s", i.Major, i.Minor, i.Patch),
|
|
|
|
fmt.Sprintf("GitCommit %s", i.GitCommit),
|
|
|
|
fmt.Sprintf("GitBranch %s", i.GitBranch),
|
|
|
|
fmt.Sprintf("BuildDate %s", i.BuildDate),
|
|
|
|
fmt.Sprintf("GoVersion %s", i.GoVersion),
|
|
|
|
fmt.Sprintf("Compiler %s", i.Compiler),
|
|
|
|
fmt.Sprintf("Platform %s", i.Platform),
|
|
|
|
)
|
|
|
|
}
|