Files
Arya K 30a68263e7 Merge dev into master (#107)
Co-authored-by: Odyssium <hi@odyssey346.dev>
Co-authored-by: Midou36O <facemioo4@gmail.com>
Co-authored-by: Arya Kiran <arya@projectsegfau.lt>
Co-authored-by: Odyssium <odyssium@noreply.codeberg.org>
Co-authored-by: medanisjbara <medanisjbara@proton.me>
Co-authored-by: Midou36O <midou36o@noreply.codeberg.org>
Co-authored-by: No-Logs.com <no-logs@noreply.codeberg.org>
Reviewed-on: https://codeberg.org/gothub/gothub/pulls/107
2023-05-08 10:24:08 +00:00

20 lines
423 B
Go

package utils
import (
"runtime/debug"
)
var Branch = "Alpha"
// Version returns the git commit hash of the current build. Taken from https://git.vern.cc/pjals/bestofbot.
func Version() string {
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
return setting.Value[:8]
}
}
}
return "unknown, please build with Go 1.13+ or use Git"
}