2017-03-21 14:34:11 +00:00
|
|
|
package version
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
// Version represents the current version of Delve.
|
|
|
|
type Version struct {
|
|
|
|
Major string
|
|
|
|
Minor string
|
|
|
|
Patch string
|
|
|
|
Metadata string
|
|
|
|
Build string
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
// DelveVersion is the current version of Delve.
|
2018-10-13 13:45:53 +00:00
|
|
|
DelveVersion = Version{
|
|
|
|
Major: "1", Minor: "1", Patch: "0", Metadata: "",
|
|
|
|
Build: "$Id: 1990ba12450cab9425a2ae62e6ab988725023d5c $",
|
|
|
|
}
|
2017-03-21 14:34:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (v Version) String() string {
|
|
|
|
ver := fmt.Sprintf("Version: %s.%s.%s", v.Major, v.Minor, v.Patch)
|
|
|
|
if v.Metadata != "" {
|
|
|
|
ver += "-" + v.Metadata
|
|
|
|
}
|
|
|
|
return fmt.Sprintf("%s\nBuild: %s", ver, v.Build)
|
|
|
|
}
|