d2/lib/version/version.go

15 lines
280 B
Go
Raw Normal View History

package version
2023-04-06 14:01:44 +00:00
import "regexp"
// Pre-built binaries will have version set correctly during build time.
2023-03-30 03:40:59 +00:00
var Version = "v0.3.0-HEAD"
2023-04-06 14:01:44 +00:00
func OnlyNumbers() string {
re, err := regexp.Compile("[0-9]+.[0-9]+.[0-9]+")
if err != nil {
return ""
}
return re.FindString(Version)
}