iperf3exporter/vendor/github.com/DisgoOrg/disgohook/api/info.go
Marvin Preuss 2343c9588a
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is failing
first commit
2021-10-20 10:08:56 +02:00

25 lines
449 B
Go

package api
import (
"runtime/debug"
"strings"
)
// Github is the disgohook github url
const Github = "https://github.com/DisgoOrg/disgohook"
// Version returns the current used disgohook version in the format vx.x.x
var Version = getVersion()
func getVersion() string {
bi, ok := debug.ReadBuildInfo()
if ok {
for _, dep := range bi.Deps {
if strings.Contains(Github, dep.Path) {
return dep.Version
}
}
}
return "unknown"
}