浏览代码

- gofmted with -s;
- Fix ineffectual assignments in Go code;
- Godoc has been updated

Ri Xu 7 年之前
父节点
当前提交
638bd44dd5
共有 4 个文件被更改,包括 26 次插入28 次删除
  1. 7 7
      cell_test.go
  2. 2 2
      chart.go
  3. 17 17
      lib_test.go
  4. 0 2
      styles.go

+ 7 - 7
cell_test.go

@@ -4,10 +4,10 @@ import "testing"
 
 func TestCheckCellInArea(t *testing.T) {
 	expectedTrueCellInAreaList := [][2]string{
-		[2]string{"c2", "A1:AAZ32"},
-		[2]string{"AA0", "Z0:AB1"},
-		[2]string{"B9", "A1:B9"},
-		[2]string{"C2", "C2:C2"},
+		{"c2", "A1:AAZ32"},
+		{"AA0", "Z0:AB1"},
+		{"B9", "A1:B9"},
+		{"C2", "C2:C2"},
 	}
 
 	for _, expectedTrueCellInArea := range expectedTrueCellInAreaList {
@@ -22,9 +22,9 @@ func TestCheckCellInArea(t *testing.T) {
 	}
 
 	expectedFalseCellInAreaList := [][2]string{
-		[2]string{"c2", "A4:AAZ32"},
-		[2]string{"C4", "D6:A1"}, // weird case, but you never know
-		[2]string{"AEF42", "BZ40:AEF41"},
+		{"c2", "A4:AAZ32"},
+		{"C4", "D6:A1"}, // weird case, but you never know
+		{"AEF42", "BZ40:AEF41"},
 	}
 
 	for _, expectedFalseCellInArea := range expectedFalseCellInAreaList {

+ 2 - 2
chart.go

@@ -170,8 +170,8 @@ func parseFormatChartSet(formatSet string) *formatChart {
 //     bar                 | bar chart
 //     barStacked          | stacked bar chart
 //     bar3D               | 3D bar chart
-//	   bar3DColumn 		   | 3D column bar chart
-// 	   bar3DPercentStacked | 3D 100% stacked bar chart
+//     bar3DColumn         | 3D column bar chart
+//     bar3DPercentStacked | 3D 100% stacked bar chart
 //     doughnut            | doughnut chart
 //     line                | line chart
 //     pie                 | pie chart

+ 17 - 17
lib_test.go

@@ -4,12 +4,12 @@ import "testing"
 
 func TestAxisLowerOrEqualThan(t *testing.T) {
 	trueExpectedInputList := [][2]string{
-		[2]string{"A", "B"},
-		[2]string{"A", "AA"},
-		[2]string{"B", "AA"},
-		[2]string{"BC", "ABCD"},
-		[2]string{"1", "2"},
-		[2]string{"2", "11"},
+		{"A", "B"},
+		{"A", "AA"},
+		{"B", "AA"},
+		{"BC", "ABCD"},
+		{"1", "2"},
+		{"2", "11"},
 	}
 
 	for _, trueExpectedInput := range trueExpectedInputList {
@@ -20,12 +20,12 @@ func TestAxisLowerOrEqualThan(t *testing.T) {
 	}
 
 	falseExpectedInputList := [][2]string{
-		[2]string{"B", "A"},
-		[2]string{"AA", "A"},
-		[2]string{"AA", "B"},
-		[2]string{"ABCD", "AB"},
-		[2]string{"2", "1"},
-		[2]string{"11", "2"},
+		{"B", "A"},
+		{"AA", "A"},
+		{"AA", "B"},
+		{"ABCD", "AB"},
+		{"2", "1"},
+		{"11", "2"},
 	}
 
 	for _, falseExpectedInput := range falseExpectedInputList {
@@ -38,11 +38,11 @@ func TestAxisLowerOrEqualThan(t *testing.T) {
 
 func TestGetCellColRow(t *testing.T) {
 	cellExpectedColRowList := map[string][2]string{
-		"C220":    [2]string{"C", "220"},
-		"aaef42":  [2]string{"aaef", "42"},
-		"bonjour": [2]string{"bonjour", ""},
-		"59":      [2]string{"", "59"},
-		"":        [2]string{"", ""},
+		"C220":    {"C", "220"},
+		"aaef42":  {"aaef", "42"},
+		"bonjour": {"bonjour", ""},
+		"59":      {"", "59"},
+		"":        {"", ""},
 	}
 
 	for cell, expectedColRow := range cellExpectedColRowList {

+ 0 - 2
styles.go

@@ -2309,12 +2309,10 @@ func (f *File) SetCellStyle(sheet, hcell, vcell string, styleID int) {
 
 	// Correct the coordinate area, such correct C1:B3 to B1:C3.
 	if vxAxis < hxAxis {
-		hcell, vcell = vcell, hcell
 		vxAxis, hxAxis = hxAxis, vxAxis
 	}
 
 	if vyAxis < hyAxis {
-		hcell, vcell = vcell, hcell
 		vyAxis, hyAxis = hyAxis, vyAxis
 	}