3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-24 12:59:33 +01:00
ergo/irc/version.go

29 lines
658 B
Go
Raw Permalink 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-06-08 16:47:18 +02:00
SemVer = "2.8.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
}
}