logginghandler/vendor/github.com/DisgoOrg/restclient/info.go
Marvin Preuss d095180eb4
All checks were successful
continuous-integration/drone/push Build is passing
build: uses go modules for tool handling
2022-01-14 13:51:56 +01:00

25 lines
459 B
Go

package restclient
import (
"runtime/debug"
"strings"
)
// Github is the restclient github url
const Github = "https://github.com/DisgoOrg/restclient"
// Version returns the current used restclient 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"
}