From 86893887406ce7fa52dd5cefad434a81b0fc4a0a Mon Sep 17 00:00:00 2001 From: Beatriz Vieira Date: Sun, 17 Nov 2019 13:41:00 -0300 Subject: [PATCH] refactor: fix NextVersion typo --- cmd/git-sv/handlers.go | 4 ++-- sv/semver.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/git-sv/handlers.go b/cmd/git-sv/handlers.go index 47147be..10a1cdd 100644 --- a/cmd/git-sv/handlers.go +++ b/cmd/git-sv/handlers.go @@ -35,7 +35,7 @@ func nextVersionHandler(git sv.Git, semverProcessor sv.SemVerCommitsProcessor) f return fmt.Errorf("error getting git log, message: %v", err) } - nextVer := semverProcessor.NexVersion(currentVer, commits) + nextVer := semverProcessor.NextVersion(currentVer, commits) fmt.Printf("%d.%d.%d\n", nextVer.Major(), nextVer.Minor(), nextVer.Patch()) return nil } @@ -76,7 +76,7 @@ func releaseNotesHandler(git sv.Git, semverProcessor sv.SemVerCommitsProcessor, return fmt.Errorf("error getting git log, message: %v", err) } - nextVer := semverProcessor.NexVersion(currentVer, commits) + nextVer := semverProcessor.NextVersion(currentVer, commits) releasenote := rnProcessor.Get(commits) fmt.Println(rnProcessor.Format(releasenote, nextVer)) diff --git a/sv/semver.go b/sv/semver.go index 51b3f97..f6e2350 100644 --- a/sv/semver.go +++ b/sv/semver.go @@ -26,7 +26,7 @@ const BreakingChangeTag string = "breakingchange" // SemVerCommitsProcessor interface type SemVerCommitsProcessor interface { - NexVersion(version semver.Version, commits []GitCommitLog) semver.Version + NextVersion(version semver.Version, commits []GitCommitLog) semver.Version } // SemVerCommitsProcessorImpl process versions using commit log @@ -47,8 +47,8 @@ func NewSemVerCommitsProcessor(unknownAsPatch bool, majorTypes, minorTypes, patc } } -// NexVersion calculates next version based on commit log -func (p SemVerCommitsProcessorImpl) NexVersion(version semver.Version, commits []GitCommitLog) semver.Version { +// NextVersion calculates next version based on commit log +func (p SemVerCommitsProcessorImpl) NextVersion(version semver.Version, commits []GitCommitLog) semver.Version { var versionToUpdate = none for _, commit := range commits { if v := p.versionTypeToUpdate(commit); v > versionToUpdate {