mirror of
https://github.com/apricote/releaser-pleaser.git
synced 2026-01-13 21:21:03 +00:00
refactor: move things to packages (#39)
This commit is contained in:
parent
44184a77f9
commit
a0a064d387
32 changed files with 923 additions and 892 deletions
19
internal/updater/updater.go
Normal file
19
internal/updater/updater.go
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue