refactor: move things to packages

This commit is contained in:
Julian Tölle 2024-08-30 22:47:50 +02:00
parent 44184a77f9
commit 11063b2d2c
32 changed files with 923 additions and 892 deletions

View file

@ -0,0 +1,19 @@
package updater
type ReleaseInfo struct {
Version string
ChangelogEntry string
}
type Updater func(string) (string, error)
type NewUpdater func(ReleaseInfo) Updater
func WithInfo(info ReleaseInfo, constructors ...NewUpdater) []Updater {
updaters := make([]Updater, 0, len(constructors))
for _, constructor := range constructors {
updaters = append(updaters, constructor(info))
}
return updaters
}