Fix issue with getting newest package version + upgrade to go 1.23 RC2

This commit is contained in:
ferreo 2024-08-05 19:42:08 +01:00
parent ee57200fb4
commit b766d5ef80
2 changed files with 13 additions and 12 deletions

2
go.mod
View File

@ -1,6 +1,6 @@
module brunel
go 1.22.5
go 1.23
require (
github.com/alphadose/haxmap v1.4.0

View File

@ -246,20 +246,21 @@ func processPackageResult(packages *haxmap.Map[string, domain.SourcePackage], re
})
return true
}
pk.Version = getHighestVer(pk.Version, newPkg.Version)
pkg, ok := pk.Packages.Get(newKey)
if !ok {
pk.Packages.Set(newKey, newPkg)
return true
}
} else {
mVer, _ := version.Parse(pkg.Version)
extVer, _ := version.Parse(strings.Split(newPkg.Version, "+b")[0])
cmpVal := version.Compare(extVer, mVer)
if cmpVal >= 0 {
pk.Version = getHighestVer(pkg.Version, newPkg.Version)
pk.Packages.Set(newKey, newPkg)
packages.Set(newPkg.Source, pk)
return true
}
}
packages.Set(newPkg.Source, pk)
return true
})
}
@ -285,9 +286,9 @@ func ProcessStalePackages(internalPackages *haxmap.Map[string, domain.SourcePack
if ver != matchedPackage.Version {
matchedPackage.NewVersion = ver
matchedPackage.Status = domain.Stale
internalPackages.Set(newPackage, matchedPackage)
}
internalPackages.Set(newPackage, matchedPackage)
return true
})
}