aboutsummaryrefslogtreecommitdiff
path: root/src/time
diff options
context:
space:
mode:
authorPetarDambovaliev <petar.atanasov.1987@gmail.com>2020-03-28 08:00:17 +0000
committerEmmanuel Odeke <emm.odeke@gmail.com>2020-03-28 08:33:16 +0000
commitd99fe1f40dfacfdebee22c13ed4471fd50f2cc1a (patch)
tree4a456f664c4273815cb6da0d228767b5d13cc937 /src/time
parentef220dc53ed204386b30879ff1882b70a7fd602b (diff)
downloadgo-d99fe1f40dfacfdebee22c13ed4471fd50f2cc1a.tar.gz
go-d99fe1f40dfacfdebee22c13ed4471fd50f2cc1a.zip
time: remove some unnecessary/duplicated global slices
Removes two variables: - days which is unused, and similar usage provided by longDayNames - months in favour of using longMonthNames Fixes #36359 Change-Id: I51b6b7408db9359c658462ba73e59ed432f655a6 GitHub-Last-Rev: 778d3ea157d363fcb5bced6d318381b44a1cac50 GitHub-Pull-Request: golang/go#36372 Reviewed-on: https://go-review.googlesource.com/c/go/+/213177 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/time')
-rw-r--r--src/time/time.go29
1 files changed, 2 insertions, 27 deletions
diff --git a/src/time/time.go b/src/time/time.go
index 3f632dbc3e..3d242f2541 100644
--- a/src/time/time.go
+++ b/src/time/time.go
@@ -287,25 +287,10 @@ const (
December
)
-var months = [...]string{
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
-}
-
// String returns the English name of the month ("January", "February", ...).
func (m Month) String() string {
if January <= m && m <= December {
- return months[m-1]
+ return longMonthNames[m-1]
}
buf := make([]byte, 20)
n := fmtInt(buf, uint64(m))
@@ -325,20 +310,10 @@ const (
Saturday
)
-var days = [...]string{
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
-}
-
// String returns the English name of the day ("Sunday", "Monday", ...).
func (d Weekday) String() string {
if Sunday <= d && d <= Saturday {
- return days[d]
+ return longDayNames[d]
}
buf := make([]byte, 20)
n := fmtInt(buf, uint64(d))