0
0
mirror of https://github.com/thegeeklab/git-sv.git synced 2024-11-10 02:10:38 +00:00
git-sv/sv/helpers_test.go

37 lines
750 B
Go
Raw Normal View History

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,
}
}
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{
Version: version,
Date: date.Truncate(time.Minute),
2019-11-17 17:43:01 +00:00
Sections: sections,
BreakingChanges: breakingChanges,
}
}
func rnSection(name string, items []GitCommitLog) ReleaseNoteSection {
return ReleaseNoteSection{
Name: name,
Items: items,
}
}