34 lines
670 B
Go
34 lines
670 B
Go
package version
|
|
|
|
import (
|
|
"fmt"
|
|
"runtime"
|
|
)
|
|
|
|
const (
|
|
Name = "muyue"
|
|
Version = "0.9.6"
|
|
Author = "La Légion de Muyue"
|
|
)
|
|
|
|
var (
|
|
// BuildDate is set at build time
|
|
BuildDate = ""
|
|
)
|
|
|
|
func FullVersion() string {
|
|
return Name + " v" + Version
|
|
}
|
|
|
|
// FullInfo returns full version information.
|
|
func FullInfo() string {
|
|
info := fmt.Sprintf("%-12s %s\n", "Version:", Version)
|
|
info += fmt.Sprintf("%-12s %s\n", "Author:", Author)
|
|
info += fmt.Sprintf("%-12s %s\n", "Go:", runtime.Version())
|
|
info += fmt.Sprintf("%-12s %s\n", "Platform:", runtime.GOOS+"/"+runtime.GOARCH)
|
|
if BuildDate != "" {
|
|
info += fmt.Sprintf("%-12s %s\n", "Build:", BuildDate)
|
|
}
|
|
return info
|
|
}
|