From 52796f6e58e95145e2964d0d313a2f721dcc040e Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Wed, 18 Jan 2017 16:05:01 +0800 Subject: Format commants, break comments after 80 characters. --- excelize.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'excelize.go') diff --git a/excelize.go b/excelize.go index f22af37..fed9613 100644 --- a/excelize.go +++ b/excelize.go @@ -8,15 +8,15 @@ import ( "strings" ) -// File define a populated xlsx.File struct. +// File define a populated XLSX file struct. type File struct { XLSX map[string]string Path string SheetCount int } -// OpenFile take the name of an XLSX file and returns a populated -// xlsx.File struct for it. +// OpenFile take the name of an XLSX file and returns a populated XLSX file +// struct for it. func OpenFile(filename string) (*File, error) { var f *zip.ReadCloser var err error @@ -110,7 +110,8 @@ func (f *File) SetCellStr(sheet string, axis string, value string) { f.saveFileList(name, replaceWorkSheetsRelationshipsNameSpace(string(output))) } -// SetCellDefault provides function to set string type value of a cell as default format without escaping the cell. +// SetCellDefault provides function to set string type value of a cell as +// default format without escaping the cell. func (f *File) SetCellDefault(sheet string, axis string, value string) { axis = strings.ToUpper(axis) var xlsx xlsxWorksheet @@ -203,7 +204,8 @@ func completeRow(xlsx xlsxWorksheet, row int, cell int) xlsxWorksheet { return xlsx } -// Replace xl/worksheets/sheet%d.xml XML tags to self-closing for compatible Office Excel 2007. +// Replace xl/worksheets/sheet%d.xml XML tags to self-closing for compatible +// Office Excel 2007. func replaceWorkSheetsRelationshipsNameSpace(workbookMarshal string) string { oldXmlns := `` newXmlns := `` @@ -211,7 +213,7 @@ func replaceWorkSheetsRelationshipsNameSpace(workbookMarshal string) string { return workbookMarshal } -// Check XML tags and fix discontinuous case, for example: +// Check XML tags and fix discontinuous case. For example: // // // @@ -232,7 +234,8 @@ func replaceWorkSheetsRelationshipsNameSpace(workbookMarshal string) string { // // // -// Noteice: this method could be very slow for large spreadsheets (more than 3000 rows one sheet). +// Noteice: this method could be very slow for large spreadsheets (more than +// 3000 rows one sheet). func checkRow(xlsx xlsxWorksheet) xlsxWorksheet { buffer := bytes.Buffer{} for k, v := range xlsx.SheetData.Row { @@ -267,7 +270,8 @@ func checkRow(xlsx xlsxWorksheet) xlsxWorksheet { // UpdateLinkedValue fix linked values within a spreadsheet are not updating in // Office Excel 2007 and 2010. This function will be remove value tag when met a -// cell have a linked value. Reference https://social.technet.microsoft.com/Forums/office/en-US/e16bae1f-6a2c-4325-8013-e989a3479066/excel-2010-linked-cells-not-updating?forum=excel +// cell have a linked value. Reference +// https://social.technet.microsoft.com/Forums/office/en-US/e16bae1f-6a2c-4325-8013-e989a3479066/excel-2010-linked-cells-not-updating?forum=excel // // Notice: after open XLSX file Excel will be update linked value and generate // new value and will prompt save file or not. -- cgit v1.2.1