releaser-pleaser/internal/updater/updater.go
2025-08-23 22:05:52 +02:00

19 lines
442 B
Go

package updater
type ReleaseInfo struct {
Version string
ChangelogEntry string
}
type Updater func(content string, filename 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
}