From 192af02a40cc745d967be1c96fcc52569ca8e8df Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Fri, 2 Sep 2016 11:54:52 +0800 Subject: Format code with golint rules --- excelize.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'excelize.go') diff --git a/excelize.go b/excelize.go index 9ee5e7c..ba474cf 100644 --- a/excelize.go +++ b/excelize.go @@ -8,12 +8,13 @@ import ( "strings" ) +// FileList define a populated xlsx.File struct. type FileList struct { Key string Value string } -// OpenFile() take the name of an XLSX file and returns a populated +// OpenFile take the name of an XLSX file and returns a populated // xlsx.File struct for it. func OpenFile(filename string) (file []FileList, err error) { var f *zip.ReadCloser @@ -25,7 +26,7 @@ func OpenFile(filename string) (file []FileList, err error) { return } -// Set int type value of a cell +// SetCellInt provide function to set int type value of a cell func SetCellInt(file []FileList, sheet string, axis string, value int) []FileList { axis = strings.ToUpper(axis) var xlsx xlsxWorksheet @@ -35,7 +36,7 @@ func SetCellInt(file []FileList, sheet string, axis string, value int) []FileLis yAxis := titleToNumber(col) name := `xl/worksheets/` + strings.ToLower(sheet) + `.xml` - xml.Unmarshal([]byte(readXml(file, name)), &xlsx) + xml.Unmarshal([]byte(readXML(file, name)), &xlsx) rows := xAxis + 1 cell := yAxis + 1 @@ -56,7 +57,7 @@ func SetCellInt(file []FileList, sheet string, axis string, value int) []FileLis return file } -// Set string type value of a cell +// SetCellStr provide function to set string type value of a cell func SetCellStr(file []FileList, sheet string, axis string, value string) []FileList { axis = strings.ToUpper(axis) var xlsx xlsxWorksheet @@ -66,7 +67,7 @@ func SetCellStr(file []FileList, sheet string, axis string, value string) []File yAxis := titleToNumber(col) name := `xl/worksheets/` + strings.ToLower(sheet) + `.xml` - xml.Unmarshal([]byte(readXml(file, name)), &xlsx) + xml.Unmarshal([]byte(readXML(file, name)), &xlsx) rows := xAxis + 1 cell := yAxis + 1 -- cgit v1.2.1