Version fetching refactoring (#373)

* Put modloader version data in struct for legibility

* Create modloader map from list

This is a minor change, but it prevents any errors with the keys not being equal to the modloader's Name field

* Less anonymous functions in modloader version retrieval

With previous code, almost everything was lazy and returned a function. Changed this to only have anonymous function in the modloader definitions, and the rest of the functions all just execute their results immediately instead or returning a function. Makes for a bit more legible code.

* Simplify FetchMavenVersionFiltered

* Rewrite version retrieval

* Use Errorf in versionutil

* Remove httpclient parameter

turned out not to be needed

* Add testing for version retrieval

* Explain fetchMavenWithFilterMap
This commit is contained in:
TheEpicBlock
2026-02-18 23:01:04 +01:00
committed by GitHub
parent 52b123018f
commit 945f852259
12 changed files with 1123 additions and 179 deletions

1
go.mod
View File

@@ -39,6 +39,7 @@ require (
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jarcoal/httpmock v1.4.1
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect