version.go 445 B

123456789101112131415161718192021
  1. package hercules
  2. import (
  3. "reflect"
  4. "strconv"
  5. "strings"
  6. )
  7. // BinaryGitHash is the Git hash of the Hercules binary file which is executing.
  8. var BinaryGitHash = "<unknown>"
  9. // BinaryVersion is Hercules' API version. It matches the package name.
  10. var BinaryVersion = 0
  11. type versionProbe struct{}
  12. func init() {
  13. parts := strings.Split(reflect.TypeOf(versionProbe{}).PkgPath(), ".")
  14. BinaryVersion, _ = strconv.Atoi(parts[len(parts)-1][1:])
  15. }