From 225f0e6400928ea17ca487fe301577eb30d9a6b4 Mon Sep 17 00:00:00 2001 From: Hau Nguyen Date: Mon, 4 Jul 2022 13:10:02 +0700 Subject: [PATCH] chore: use make-go-great/date-go --- go.mod | 2 +- go.sum | 4 ++-- internal/changelog/generate.go | 4 ++-- internal/convention/option.go | 5 +++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index d361bff..d39c6fe 100644 --- a/go.mod +++ b/go.mod @@ -4,8 +4,8 @@ go 1.18 require ( github.com/go-git/go-git/v5 v5.4.2 - github.com/haunt98/clock-go v0.3.0 github.com/make-go-great/color-go v0.3.0 + github.com/make-go-great/date-go v0.4.0 github.com/make-go-great/ioe-go v0.4.0 github.com/make-go-great/markdown-go v0.5.0 github.com/make-go-great/rst-go v0.3.0 diff --git a/go.sum b/go.sum index 3c61ecd..67fb89a 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,6 @@ github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/haunt98/clock-go v0.3.0 h1:3Kb7Tyg4DEx9xdQzpWXj0mJPyvJIT8uTpjh/nqVeGAg= -github.com/haunt98/clock-go v0.3.0/go.mod h1:kSgtEYoM+zncE4P0Ujm7LmJP5nnWb4Rx7IGqVtKeqEI= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= @@ -58,6 +56,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/make-go-great/color-go v0.3.0 h1:ZVtVk/wVVsZZwSJG7PZpsY5zwIyGao5VoN48yKfSzYA= github.com/make-go-great/color-go v0.3.0/go.mod h1:G5G8IJ3PUo+vSQ+UvnfaswF8O/piVIhFJKv1mQjBGpI= +github.com/make-go-great/date-go v0.4.0 h1:bH1jyb9BBlig+R+jJMRIIcKXI9pRTdJetS0tHkJSv1s= +github.com/make-go-great/date-go v0.4.0/go.mod h1:8EPEcTTWt69iOO41+Bb8EbggAwJ7/l7ml11BJLc9w/o= github.com/make-go-great/ioe-go v0.4.0 h1:abRH8J01am7A9VsinEG0WnXDiT1CWk7Cd0auRvWuNyQ= github.com/make-go-great/ioe-go v0.4.0/go.mod h1:RMXnZIKVXk52+H7EJZoBpZ3SSuxUPk9UFqpHFZ9uOUk= github.com/make-go-great/markdown-go v0.5.0 h1:Tt/0i3/X02x4EW1mhSvTaqd0K+ElmfuscLTfEfpAWF4= diff --git a/internal/changelog/generate.go b/internal/changelog/generate.go index 436c52b..41ce4d1 100644 --- a/internal/changelog/generate.go +++ b/internal/changelog/generate.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "github.com/haunt98/clock-go" + "github.com/make-go-great/date-go" ) func generateVersionHeaderValue(version string, when time.Time) string { - return fmt.Sprintf("%s (%s)", version, clock.FormatDate(when)) + return fmt.Sprintf("%s (%s)", version, date.FormatDateByDefault(when, time.Local)) } diff --git a/internal/convention/option.go b/internal/convention/option.go index 1eb7746..dab6471 100644 --- a/internal/convention/option.go +++ b/internal/convention/option.go @@ -5,9 +5,10 @@ import ( "fmt" "regexp" "strings" + "time" "github.com/haunt98/changeloguru/internal/git" - "github.com/haunt98/clock-go" + "github.com/make-go-great/date-go" ) const ( @@ -58,7 +59,7 @@ func GetTypeAndScope(gitCommit git.Commit) OptionFn { func AddAuthorDate(gitCommit git.Commit) OptionFn { return func(c *Commit) error { - c.RawHeader = fmt.Sprintf("%s (%s)", c.RawHeader, clock.FormatDate(gitCommit.Author.When)) + c.RawHeader = fmt.Sprintf("%s (%s)", c.RawHeader, date.FormatDateByDefault(gitCommit.Author.When, time.Local)) return nil }