3
0
mirror of https://github.com/ergochat/ergo.git synced 2025-02-12 19:50:40 +01:00
ergo/irc/version.go

29 lines
659 B
Go
Raw Normal View History

2020-05-21 11:25:30 -04:00
// Copyright (c) 2020 Shivaram Lingamneni
// Released under the MIT license
package irc
import "fmt"
const (
2021-05-25 00:34:38 -04:00
// SemVer is the semantic version of Ergo.
2024-02-11 00:12:22 -05:00
SemVer = "2.14.0-unreleased"
2020-05-21 11:25:30 -04:00
)
var (
2021-05-25 00:34:38 -04:00
// Ver is the full version of Ergo, used in responses to clients.
Ver = fmt.Sprintf("ergo-%s", SemVer)
2020-05-21 11:25:30 -04: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 00:34:38 -04:00
Ver = fmt.Sprintf("ergo-%s", version)
2020-05-21 11:25:30 -04:00
} else if len(Commit) == 40 {
2021-05-25 00:34:38 -04:00
Ver = fmt.Sprintf("ergo-%s-%s", SemVer, Commit[:16])
2020-05-21 11:25:30 -04:00
}
}