dispatch/version/version.go
2018-11-22 11:31:02 +01:00

27 lines
361 B
Go

package version
import (
"fmt"
"strings"
"time"
)
var (
Tag = "dev"
Commit = "none"
Date = "unknown"
)
func init() {
vParts := strings.Split(Tag, "-")
if len(vParts) > 1 {
Tag = fmt.Sprintf("%s + %s commits", vParts[0], vParts[1])
}
t, err := time.Parse(time.RFC3339, Date)
if err == nil {
Date = t.Format("02 Jan 2006, 15:04:05")
}
}