You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

version.go 647B

12345678910111213141516171819202122232425262728
  1. // Copyright (c) 2020 Shivaram Lingamneni
  2. // Released under the MIT license
  3. package irc
  4. import "fmt"
  5. const (
  6. // SemVer is the semantic version of Ergo.
  7. SemVer = "2.7.0"
  8. )
  9. var (
  10. // Ver is the full version of Ergo, used in responses to clients.
  11. Ver = fmt.Sprintf("ergo-%s", SemVer)
  12. // Commit is the full git hash, if available
  13. Commit string
  14. )
  15. // initialize version strings (these are set in package main via linker flags)
  16. func SetVersionString(version, commit string) {
  17. Commit = commit
  18. if version != "" {
  19. Ver = fmt.Sprintf("ergo-%s", version)
  20. } else if len(Commit) == 40 {
  21. Ver = fmt.Sprintf("ergo-%s-%s", SemVer, Commit[:16])
  22. }
  23. }