From 4bc1db5397e7f50c5490b9343ca0849be30abefe Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Wed, 15 Feb 2023 01:15:42 +0300 Subject: [PATCH] add func to generate java version string --- domain/structures.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/domain/structures.go b/domain/structures.go index 9fa0aa8..61aa4fa 100644 --- a/domain/structures.go +++ b/domain/structures.go @@ -1,10 +1,16 @@ package domain +import "strconv" + type JavaVersion struct { VersionNums `json:"version"` 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 { Os string `json:"os"` Arch string `json:"arch"`