@@ -1136,7 +1136,7 @@ func getNumberPartLen(n float64) (int, int) {
1136
1136
return len (parts [0 ]), 0
1137
1137
}
1138
1138
1139
- // getNumberFmtConf generate the number format padding and place holder
1139
+ // getNumberFmtConf generate the number format padding and placeholder
1140
1140
// configurations.
1141
1141
func (nf * numberFormat ) getNumberFmtConf () {
1142
1142
for _ , token := range nf .section [nf .sectionIdx ].Items {
@@ -1183,9 +1183,9 @@ func (nf *numberFormat) printNumberLiteral(text string) string {
1183
1183
if nf .usePositive {
1184
1184
result += "-"
1185
1185
}
1186
- for i , token := range nf .section [nf .sectionIdx ].Items {
1186
+ for _ , token := range nf .section [nf .sectionIdx ].Items {
1187
1187
if token .TType == nfp .TokenTypeCurrencyLanguage {
1188
- if err , changeNumFmtCode := nf .currencyLanguageHandler (i , token ); err != nil || changeNumFmtCode {
1188
+ if err , changeNumFmtCode := nf .currencyLanguageHandler (token ); err != nil || changeNumFmtCode {
1189
1189
return nf .value
1190
1190
}
1191
1191
result += nf .currencyString
@@ -1321,7 +1321,7 @@ func (nf *numberFormat) dateTimeHandler() string {
1321
1321
nf .t , nf .hours , nf .seconds = timeFromExcelTime (nf .number , nf .date1904 ), false , false
1322
1322
for i , token := range nf .section [nf .sectionIdx ].Items {
1323
1323
if token .TType == nfp .TokenTypeCurrencyLanguage {
1324
- if err , changeNumFmtCode := nf .currencyLanguageHandler (i , token ); err != nil || changeNumFmtCode {
1324
+ if err , changeNumFmtCode := nf .currencyLanguageHandler (token ); err != nil || changeNumFmtCode {
1325
1325
return nf .value
1326
1326
}
1327
1327
nf .result += nf .currencyString
@@ -1392,7 +1392,7 @@ func (nf *numberFormat) positiveHandler() string {
1392
1392
1393
1393
// currencyLanguageHandler will be handling currency and language types tokens
1394
1394
// for a number format expression.
1395
- func (nf * numberFormat ) currencyLanguageHandler (i int , token nfp.Token ) (error , bool ) {
1395
+ func (nf * numberFormat ) currencyLanguageHandler (token nfp.Token ) (error , bool ) {
1396
1396
for _ , part := range token .Parts {
1397
1397
if inStrSlice (supportedTokenTypes , part .Token .TType , true ) == - 1 {
1398
1398
return ErrUnsupportedNumberFormat , false
@@ -1491,7 +1491,7 @@ func localMonthsNameFrench(t time.Time, abbr int) string {
1491
1491
// localMonthsNameIrish returns the Irish name of the month.
1492
1492
func localMonthsNameIrish (t time.Time , abbr int ) string {
1493
1493
if abbr == 3 {
1494
- return monthNamesIrishAbbr [int (t .Month ()- 1 )]
1494
+ return monthNamesIrishAbbr [(t .Month () - 1 )]
1495
1495
}
1496
1496
if abbr == 4 {
1497
1497
return monthNamesIrish [int (t .Month ())- 1 ]
@@ -1524,7 +1524,7 @@ func localMonthsNameGerman(t time.Time, abbr int) string {
1524
1524
// localMonthsNameChinese1 returns the Chinese name of the month.
1525
1525
func localMonthsNameChinese1 (t time.Time , abbr int ) string {
1526
1526
if abbr == 3 {
1527
- return monthNamesChineseAbbrPlus [int ( t .Month () )]
1527
+ return monthNamesChineseAbbrPlus [t .Month ()]
1528
1528
}
1529
1529
if abbr == 4 {
1530
1530
return monthNamesChinesePlus [int (t .Month ())- 1 ]
@@ -1543,15 +1543,15 @@ func localMonthsNameChinese2(t time.Time, abbr int) string {
1543
1543
// localMonthsNameChinese3 returns the Chinese name of the month.
1544
1544
func localMonthsNameChinese3 (t time.Time , abbr int ) string {
1545
1545
if abbr == 3 || abbr == 4 {
1546
- return monthNamesChineseAbbrPlus [int ( t .Month () )]
1546
+ return monthNamesChineseAbbrPlus [t .Month ()]
1547
1547
}
1548
1548
return strconv .Itoa (int (t .Month ()))
1549
1549
}
1550
1550
1551
1551
// localMonthsNameKorean returns the Korean name of the month.
1552
1552
func localMonthsNameKorean (t time.Time , abbr int ) string {
1553
1553
if abbr == 3 || abbr == 4 {
1554
- return monthNamesKoreanAbbrPlus [int ( t .Month () )]
1554
+ return monthNamesKoreanAbbrPlus [t .Month ()]
1555
1555
}
1556
1556
return strconv .Itoa (int (t .Month ()))
1557
1557
}
@@ -1562,7 +1562,7 @@ func localMonthsNameTraditionalMongolian(t time.Time, abbr int) string {
1562
1562
if abbr == 5 {
1563
1563
return "M"
1564
1564
}
1565
- return monthNamesTradMongolian [int ( t .Month ()- 1 ) ]
1565
+ return monthNamesTradMongolian [t .Month ()- 1 ]
1566
1566
}
1567
1567
1568
1568
// localMonthsNameRussian returns the Russian name of the month.
@@ -1642,12 +1642,12 @@ func localMonthsNameWelsh(t time.Time, abbr int) string {
1642
1642
// localMonthsNameVietnamese returns the Vietnamese name of the month.
1643
1643
func localMonthsNameVietnamese (t time.Time , abbr int ) string {
1644
1644
if abbr == 3 {
1645
- return monthNamesVietnameseAbbr3 [int ( t .Month ()- 1 ) ]
1645
+ return monthNamesVietnameseAbbr3 [t .Month ()- 1 ]
1646
1646
}
1647
1647
if abbr == 5 {
1648
- return monthNamesVietnameseAbbr5 [int ( t .Month ()- 1 ) ]
1648
+ return monthNamesVietnameseAbbr5 [t .Month ()- 1 ]
1649
1649
}
1650
- return monthNamesVietnamese [int ( t .Month ()- 1 ) ]
1650
+ return monthNamesVietnamese [t .Month ()- 1 ]
1651
1651
}
1652
1652
1653
1653
// localMonthsNameWolof returns the Wolof name of the month.
@@ -1675,15 +1675,15 @@ func localMonthsNameXhosa(t time.Time, abbr int) string {
1675
1675
// localMonthsNameYi returns the Yi name of the month.
1676
1676
func localMonthsNameYi (t time.Time , abbr int ) string {
1677
1677
if abbr == 3 || abbr == 4 {
1678
- return monthNamesYiSuffix [int ( t .Month ()- 1 ) ]
1678
+ return monthNamesYiSuffix [t .Month ()- 1 ]
1679
1679
}
1680
1680
return string ([]rune (monthNamesYi [int (t .Month ())- 1 ])[:1 ])
1681
1681
}
1682
1682
1683
1683
// localMonthsNameZulu returns the Zulu name of the month.
1684
1684
func localMonthsNameZulu (t time.Time , abbr int ) string {
1685
1685
if abbr == 3 {
1686
- return monthNamesZuluAbbr [int ( t .Month ()- 1 ) ]
1686
+ return monthNamesZuluAbbr [t .Month ()- 1 ]
1687
1687
}
1688
1688
if abbr == 4 {
1689
1689
return monthNamesZulu [int (t .Month ())- 1 ]
@@ -1737,16 +1737,16 @@ func (nf *numberFormat) dateTimesHandler(i int, token nfp.Token) {
1737
1737
return
1738
1738
}
1739
1739
}
1740
- nf .yearsHandler (i , token )
1741
- nf .daysHandler (i , token )
1740
+ nf .yearsHandler (token )
1741
+ nf .daysHandler (token )
1742
1742
nf .hoursHandler (i , token )
1743
1743
nf .minutesHandler (token )
1744
1744
nf .secondsHandler (token )
1745
1745
}
1746
1746
1747
1747
// yearsHandler will be handling years in the date and times types tokens for a
1748
1748
// number format expression.
1749
- func (nf * numberFormat ) yearsHandler (i int , token nfp.Token ) {
1749
+ func (nf * numberFormat ) yearsHandler (token nfp.Token ) {
1750
1750
years := strings .Contains (strings .ToUpper (token .TValue ), "Y" )
1751
1751
if years && len (token .TValue ) <= 2 {
1752
1752
nf .result += strconv .Itoa (nf .t .Year ())[2 :]
@@ -1760,7 +1760,7 @@ func (nf *numberFormat) yearsHandler(i int, token nfp.Token) {
1760
1760
1761
1761
// daysHandler will be handling days in the date and times types tokens for a
1762
1762
// number format expression.
1763
- func (nf * numberFormat ) daysHandler (i int , token nfp.Token ) {
1763
+ func (nf * numberFormat ) daysHandler (token nfp.Token ) {
1764
1764
if strings .Contains (strings .ToUpper (token .TValue ), "D" ) {
1765
1765
switch len (token .TValue ) {
1766
1766
case 1 :
0 commit comments