mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-02-06 17:57:05 +00:00
20 lines
417 B
Go
20 lines
417 B
Go
|
|
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
|
||
|
|
}
|