add func to generate java version string

This commit is contained in:
cyber-dream 2023-02-15 01:15:42 +03:00
parent f44e6b104b
commit 4bc1db5397

View File

@ -1,10 +1,16 @@
package domain package domain
import "strconv"
type JavaVersion struct { type JavaVersion struct {
VersionNums `json:"version"` VersionNums `json:"version"`
Specifics []JavaVersionSpecifics `json:"specifics"` Specifics []JavaVersionSpecifics `json:"specifics"`
} }
func (jVer *JavaVersion) GetVersionString() string {
return strconv.Itoa(jVer.Major) + "." + strconv.Itoa(jVer.Minor) + "." + strconv.Itoa(jVer.Patch)
}
type JavaVersionSpecifics struct { type JavaVersionSpecifics struct {
Os string `json:"os"` Os string `json:"os"`
Arch string `json:"arch"` Arch string `json:"arch"`