mirror of
https://github.com/golang/go
synced 2024-11-11 19:51:37 -07:00
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: 778d3ea157
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>
This commit is contained in:
parent
ef220dc53e
commit
d99fe1f40d
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user