Geoffrey J. Teale 8 years ago
parent
commit
678e0fe7a5
5 changed files with 9 additions and 10 deletions
  1. 2 2
      cell.go
  2. 1 2
      cell_test.go
  3. 3 3
      file.go
  4. 1 1
      sheet.go
  5. 2 2
      xmlStyle.go

+ 2 - 2
cell.go

@@ -373,10 +373,10 @@ func parseTime(c *Cell) (string, error) {
 	// if this is a 12 hour or 24 hours time format, not the
 	// number of 'h' characters.
 	if is12HourTime(format) {
-		format = strings.Replace(format, "hh", "03", 1)		
+		format = strings.Replace(format, "hh", "03", 1)
 		format = strings.Replace(format, "h", "3", 1)
 	} else {
-		format = strings.Replace(format, "hh", "15", 1)		
+		format = strings.Replace(format, "hh", "15", 1)
 		format = strings.Replace(format, "h", "15", 1)
 	}
 	for _, repl := range replacements {

+ 1 - 2
cell_test.go

@@ -515,11 +515,10 @@ func (s *CellSuite) TestIsTimeFormat(c *C) {
 	c.Assert(isTimeFormat("z"), Equals, false)
 }
 
-
 func (s *CellSuite) TestIs12HourtTime(c *C) {
 	c.Assert(is12HourTime("am/pm"), Equals, true)
 	c.Assert(is12HourTime("AM/PM"), Equals, true)
 	c.Assert(is12HourTime("a/p"), Equals, true)
-	c.Assert(is12HourTime("A/P"), Equals, true)	
+	c.Assert(is12HourTime("A/P"), Equals, true)
 	c.Assert(is12HourTime("x"), Equals, false)
 }

+ 3 - 3
file.go

@@ -4,12 +4,12 @@ import (
 	"archive/zip"
 	"bytes"
 	"encoding/xml"
+	"errors"
 	"fmt"
 	"io"
 	"os"
 	"strconv"
 	"strings"
-	"errors"
 )
 
 // File is a high level structure providing a slice of Sheet structs
@@ -219,8 +219,8 @@ func (f *File) MarshallParts() (map[string]string, error) {
 		f.styles = newXlsxStyleSheet(f.theme)
 	}
 	f.styles.reset()
-	if len(f.Sheets)==0 {
-		err:= errors.New("Workbook must contains atleast one worksheet")
+	if len(f.Sheets) == 0 {
+		err := errors.New("Workbook must contains atleast one worksheet")
 		return nil, err
 	}
 	for _, sheet := range f.Sheets {

+ 1 - 1
sheet.go

@@ -237,7 +237,7 @@ func (s *Sheet) makeXLSXSheet(refTable *RefTable, styles *xlsxStyleSheet) *xlsxW
 		if col.Width == 0 {
 			col.Width = ColWidth
 			customWidth = false
-			
+
 		} else {
 			customWidth = true
 		}

+ 2 - 2
xmlStyle.go

@@ -57,9 +57,9 @@ var builtInNumFmt = map[int]string{
 	49: "@",
 }
 
-var builtInNumFmtInv = make(map[string]int,40)
+var builtInNumFmtInv = make(map[string]int, 40)
 
-func init () {
+func init() {
 	for k, v := range builtInNumFmt {
 		builtInNumFmtInv[v] = k
 	}