Skip to content

Commit 638bd44

Browse files
committed
- gofmted with -s;
- Fix ineffectual assignments in Go code; - Godoc has been updated
1 parent 12760a7 commit 638bd44

File tree

4 files changed

+26
-28
lines changed

4 files changed

+26
-28
lines changed

cell_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import "testing"
44

55
func TestCheckCellInArea(t *testing.T) {
66
expectedTrueCellInAreaList := [][2]string{
7-
[2]string{"c2", "A1:AAZ32"},
8-
[2]string{"AA0", "Z0:AB1"},
9-
[2]string{"B9", "A1:B9"},
10-
[2]string{"C2", "C2:C2"},
7+
{"c2", "A1:AAZ32"},
8+
{"AA0", "Z0:AB1"},
9+
{"B9", "A1:B9"},
10+
{"C2", "C2:C2"},
1111
}
1212

1313
for _, expectedTrueCellInArea := range expectedTrueCellInAreaList {
@@ -22,9 +22,9 @@ func TestCheckCellInArea(t *testing.T) {
2222
}
2323

2424
expectedFalseCellInAreaList := [][2]string{
25-
[2]string{"c2", "A4:AAZ32"},
26-
[2]string{"C4", "D6:A1"}, // weird case, but you never know
27-
[2]string{"AEF42", "BZ40:AEF41"},
25+
{"c2", "A4:AAZ32"},
26+
{"C4", "D6:A1"}, // weird case, but you never know
27+
{"AEF42", "BZ40:AEF41"},
2828
}
2929

3030
for _, expectedFalseCellInArea := range expectedFalseCellInAreaList {

chart.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ func parseFormatChartSet(formatSet string) *formatChart {
170170
// bar | bar chart
171171
// barStacked | stacked bar chart
172172
// bar3D | 3D bar chart
173-
// bar3DColumn | 3D column bar chart
174-
// bar3DPercentStacked | 3D 100% stacked bar chart
173+
// bar3DColumn | 3D column bar chart
174+
// bar3DPercentStacked | 3D 100% stacked bar chart
175175
// doughnut | doughnut chart
176176
// line | line chart
177177
// pie | pie chart

lib_test.go

+17-17
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import "testing"
44

55
func TestAxisLowerOrEqualThan(t *testing.T) {
66
trueExpectedInputList := [][2]string{
7-
[2]string{"A", "B"},
8-
[2]string{"A", "AA"},
9-
[2]string{"B", "AA"},
10-
[2]string{"BC", "ABCD"},
11-
[2]string{"1", "2"},
12-
[2]string{"2", "11"},
7+
{"A", "B"},
8+
{"A", "AA"},
9+
{"B", "AA"},
10+
{"BC", "ABCD"},
11+
{"1", "2"},
12+
{"2", "11"},
1313
}
1414

1515
for _, trueExpectedInput := range trueExpectedInputList {
@@ -20,12 +20,12 @@ func TestAxisLowerOrEqualThan(t *testing.T) {
2020
}
2121

2222
falseExpectedInputList := [][2]string{
23-
[2]string{"B", "A"},
24-
[2]string{"AA", "A"},
25-
[2]string{"AA", "B"},
26-
[2]string{"ABCD", "AB"},
27-
[2]string{"2", "1"},
28-
[2]string{"11", "2"},
23+
{"B", "A"},
24+
{"AA", "A"},
25+
{"AA", "B"},
26+
{"ABCD", "AB"},
27+
{"2", "1"},
28+
{"11", "2"},
2929
}
3030

3131
for _, falseExpectedInput := range falseExpectedInputList {
@@ -38,11 +38,11 @@ func TestAxisLowerOrEqualThan(t *testing.T) {
3838

3939
func TestGetCellColRow(t *testing.T) {
4040
cellExpectedColRowList := map[string][2]string{
41-
"C220": [2]string{"C", "220"},
42-
"aaef42": [2]string{"aaef", "42"},
43-
"bonjour": [2]string{"bonjour", ""},
44-
"59": [2]string{"", "59"},
45-
"": [2]string{"", ""},
41+
"C220": {"C", "220"},
42+
"aaef42": {"aaef", "42"},
43+
"bonjour": {"bonjour", ""},
44+
"59": {"", "59"},
45+
"": {"", ""},
4646
}
4747

4848
for cell, expectedColRow := range cellExpectedColRowList {

styles.go

-2
Original file line numberDiff line numberDiff line change
@@ -2309,12 +2309,10 @@ func (f *File) SetCellStyle(sheet, hcell, vcell string, styleID int) {
23092309

23102310
// Correct the coordinate area, such correct C1:B3 to B1:C3.
23112311
if vxAxis < hxAxis {
2312-
hcell, vcell = vcell, hcell
23132312
vxAxis, hxAxis = hxAxis, vxAxis
23142313
}
23152314

23162315
if vyAxis < hyAxis {
2317-
hcell, vcell = vcell, hcell
23182316
vyAxis, hyAxis = hyAxis, vyAxis
23192317
}
23202318

0 commit comments

Comments
 (0)