2019-11-17 17:43:01 +00:00
|
|
|
package sv
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/Masterminds/semver"
|
|
|
|
)
|
|
|
|
|
|
|
|
func version(v string) semver.Version {
|
|
|
|
r, _ := semver.NewVersion(v)
|
|
|
|
return *r
|
|
|
|
}
|
|
|
|
|
|
|
|
func commitlog(t string, metadata map[string]string) GitCommitLog {
|
|
|
|
return GitCommitLog{
|
|
|
|
Type: t,
|
|
|
|
Subject: "subject text",
|
|
|
|
Metadata: metadata,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-25 20:16:56 +00:00
|
|
|
func releaseNote(version *semver.Version, date time.Time, sections map[string]ReleaseNoteSection, breakingChanges []string) ReleaseNote {
|
2019-11-17 17:43:01 +00:00
|
|
|
return ReleaseNote{
|
2020-02-02 00:00:53 +00:00
|
|
|
Version: version,
|
2020-02-01 21:19:38 +00:00
|
|
|
Date: date.Truncate(time.Minute),
|
2019-11-17 17:43:01 +00:00
|
|
|
Sections: sections,
|
|
|
|
BreakingChanges: breakingChanges,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-02 02:51:29 +00:00
|
|
|
func newReleaseNoteSection(name string, items []GitCommitLog) ReleaseNoteSection {
|
2019-11-17 17:43:01 +00:00
|
|
|
return ReleaseNoteSection{
|
|
|
|
Name: name,
|
|
|
|
Items: items,
|
|
|
|
}
|
|
|
|
}
|