Skip to content

Commit 0763da3

Browse files
committed
refactor(helper): Unify the declaration format of cache variables
1 parent 63a26af commit 0763da3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

helper.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ var defaultLayouts = []string{
8686
}
8787

8888
// layoutCache caches format to layout conversions to avoid repeated parsing
89-
var layoutCache = sync.Map{}
89+
var layoutCache sync.Map
9090

9191
// converts format to layout.
9292
func format2layout(format string) string {
@@ -125,7 +125,7 @@ func format2layout(format string) string {
125125
}
126126

127127
// timezoneCache caches parsed timezone locations to avoid repeated parsing
128-
var timezoneCache = sync.Map{}
128+
var timezoneCache sync.Map
129129

130130
// parses a timezone string as a time.Location instance.
131131
func parseTimezone(timezone string) (loc *Location, err error) {
@@ -149,7 +149,7 @@ func parseTimezone(timezone string) (loc *Location, err error) {
149149
}
150150

151151
// durationCache caches parsed durations to avoid repeated parsing
152-
var durationCache = sync.Map{}
152+
var durationCache sync.Map
153153

154154
// parses a duration string as a time.Duration instance.
155155
func parseDuration(duration string) (dur Duration, err error) {

0 commit comments

Comments
 (0)