3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-28 23:19:30 +01:00
ergo/irc/version.go

29 lines
658 B
Go
Raw Normal View History

2020-05-21 17:25:30 +02:00
// Copyright (c) 2020 Shivaram Lingamneni
// Released under the MIT license
package irc
import "fmt"
const (
2021-05-25 06:34:38 +02:00
// SemVer is the semantic version of Ergo.
2021-04-18 23:03:25 +02:00
SemVer = "2.7.0-unreleased"
2020-05-21 17:25:30 +02:00
)
var (
2021-05-25 06:34:38 +02:00
// Ver is the full version of Ergo, used in responses to clients.
Ver = fmt.Sprintf("ergo-%s", SemVer)
2020-05-21 17:25:30 +02:00
// Commit is the full git hash, if available
Commit string
)
// initialize version strings (these are set in package main via linker flags)
func SetVersionString(version, commit string) {
Commit = commit
if version != "" {
2021-05-25 06:34:38 +02:00
Ver = fmt.Sprintf("ergo-%s", version)
2020-05-21 17:25:30 +02:00
} else if len(Commit) == 40 {
2021-05-25 06:34:38 +02:00
Ver = fmt.Sprintf("ergo-%s-%s", SemVer, Commit[:16])
2020-05-21 17:25:30 +02:00
}
}