* 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
* Fix ignore file inconsistencies
.packwizignore is supposed to work like .gitignore, yet it fails
miserably at doing so, being able to ignore only global patterns like
*.zip, and failing at patterns like /*.zip.
This commit introduces two changes to fix the issue:
- First, it uses a more up-to-date library. denormal/go-gitignore has
not been updated since 2018 and has long open issues and pull
requests, one of which tries to address leading slash ignoring, a-la
/*.zip. denormal account seems to be abandoned since around the same
year, so it makes sense to find a new library that does roughly the
same thing.
Gladly so, there's actually a library by sabhiram that shares the same
name (but not the package name itself - which is just ignore - so it
probably requires aliasing when importing).
- Secondly, it checks relative paths against ignore file instead of the
absolute ones, which makes it possible to use leading slash (and
probably some other features) with the new library.
From personal tests, it seems to address most - if not all - of the
inconsistencies. However, since it's a different library more throughout
testing probably wouldn't hurt to make sure it didn't break anything.
* Move dependency to main block