workgroups/vendor/github.com/DisgoOrg/restclient/info.go
Marvin Preuss 1d4ae27878
All checks were successful
continuous-integration/drone/push Build is passing
ci: drone yaml with reusable anchors
2021-09-24 17:34:17 +02: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"
}