Merge remote-tracking branch 'origin/main'

This commit is contained in:
cyber-dream 2023-02-15 01:16:04 +03:00
commit 7e2a75d11d

View File

@ -3,7 +3,7 @@ package domain
import "strconv"
type JavaVersion struct {
VersionNums `json:"version"`
VersionNums `json:"versionnums"`
Specifics []JavaVersionSpecifics `json:"specifics"`
}
@ -33,6 +33,31 @@ type VersionNums struct {
Patch int `json:"patch"`
}
func (v *VersionNums) FillFromString(maj string, min string, patch string) error {
iMaj, err := strconv.Atoi(maj)
if err != nil {
return err
}
iMin := 0
iMin, err = strconv.Atoi(min)
if err != nil {
return err
}
iPatch := 0
iPatch, err = strconv.Atoi(patch)
if err != nil {
return err
}
v.Major = iMaj
v.Minor = iMin
v.Patch = iPatch
return nil
}
type Version struct {
AssetIndex AssetIndex `json:"assetIndex"`
Downloads struct {