From ec37b114c3b704a84c66fcf3e135c9df88ffb24d Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 6 Aug 2018 10:21:24 +0800 Subject: Fixes #256 and format document. --- rows.go | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) (limited to 'rows.go') diff --git a/rows.go b/rows.go index ba569ad..521a945 100644 --- a/rows.go +++ b/rows.go @@ -132,7 +132,7 @@ func (err ErrSheetNotExist) Error() string { // Rows return a rows iterator. For example: // -// rows, err := xlsx.GetRows("Sheet1") +// rows, err := xlsx.Rows("Sheet1") // for rows.Next() { // for _, colCell := range rows.Columns() { // fmt.Print(colCell, "\t") @@ -202,7 +202,7 @@ func (f *File) SetRowHeight(sheet string, row int, height float64) { xlsx.SheetData.Row[rowIdx].CustomHeight = true } -// getRowHeight provides function to get row height in pixels by given sheet +// getRowHeight provides a function to get row height in pixels by given sheet // name and row index. func (f *File) getRowHeight(sheet string, row int) int { xlsx := f.workSheetReader(sheet) @@ -215,7 +215,7 @@ func (f *File) getRowHeight(sheet string, row int) int { return int(defaultRowHeightPixels) } -// GetRowHeight provides function to get row height by given worksheet name +// GetRowHeight provides a function to get row height by given worksheet name // and row index. For example, get the height of the first row in Sheet1: // // xlsx.GetRowHeight("Sheet1", 1) @@ -231,7 +231,7 @@ func (f *File) GetRowHeight(sheet string, row int) float64 { return defaultRowHeightPixels } -// sharedStringsReader provides function to get the pointer to the structure +// sharedStringsReader provides a function to get the pointer to the structure // after deserialization of xl/sharedStrings.xml. func (f *File) sharedStringsReader() *xlsxSST { if f.SharedStrings == nil { @@ -246,8 +246,9 @@ func (f *File) sharedStringsReader() *xlsxSST { return f.SharedStrings } -// getValueFrom return a value from a column/row cell, this function is inteded -// to be used with for range on rows an argument with the xlsx opened file. +// getValueFrom return a value from a column/row cell, this function is +// inteded to be used with for range on rows an argument with the xlsx opened +// file. func (xlsx *xlsxC) getValueFrom(f *File, d *xlsxSST) (string, error) { switch xlsx.T { case "s": @@ -315,9 +316,9 @@ func (f *File) SetRowOutlineLevel(sheet string, rowIndex int, level uint8) { xlsx.SheetData.Row[rowIndex].OutlineLevel = level } -// GetRowOutlineLevel provides a function to get outline level number of a single row by given -// worksheet name and row index. For example, get outline number of row 2 in -// Sheet1: +// GetRowOutlineLevel provides a function to get outline level number of a +// single row by given worksheet name and row index. For example, get outline +// number of row 2 in Sheet1: // // xlsx.GetRowOutlineLevel("Sheet1", 2) // @@ -329,8 +330,8 @@ func (f *File) GetRowOutlineLevel(sheet string, rowIndex int) uint8 { return xlsx.SheetData.Row[rowIndex].OutlineLevel } -// RemoveRow provides function to remove single row by given worksheet name and -// row index. For example, remove row 3 in Sheet1: +// RemoveRow provides a function to remove single row by given worksheet name +// and row index. For example, remove row 3 in Sheet1: // // xlsx.RemoveRow("Sheet1", 2) // @@ -349,8 +350,8 @@ func (f *File) RemoveRow(sheet string, row int) { } } -// InsertRow provides function to insert a new row before given row index. For -// example, create a new row before row 3 in Sheet1: +// InsertRow provides a function to insert a new row before given row index. +// For example, create a new row before row 3 in Sheet1: // // xlsx.InsertRow("Sheet1", 2) // @@ -362,8 +363,8 @@ func (f *File) InsertRow(sheet string, row int) { f.adjustHelper(sheet, -1, row, 1) } -// checkRow provides function to check and fill each column element for all rows -// and make that is continuous in a worksheet of XML. For example: +// checkRow provides a function to check and fill each column element for all +// rows and make that is continuous in a worksheet of XML. For example: // // // @@ -416,7 +417,7 @@ func checkRow(xlsx *xlsxWorksheet) { } } -// completeRow provides function to check and fill each column element for a +// completeRow provides a function to check and fill each column element for a // single row and make that is continuous in a worksheet of XML by given row // index and axis. func completeRow(xlsx *xlsxWorksheet, row, cell int) { @@ -448,9 +449,9 @@ func completeRow(xlsx *xlsxWorksheet, row, cell int) { } } -// convertRowHeightToPixels provides function to convert the height of a cell -// from user's units to pixels. If the height hasn't been set by the user we use -// the default value. If the row is hidden it has a value of zero. +// convertRowHeightToPixels provides a function to convert the height of a +// cell from user's units to pixels. If the height hasn't been set by the user +// we use the default value. If the row is hidden it has a value of zero. func convertRowHeightToPixels(height float64) float64 { var pixels float64 if height == 0 { -- cgit v1.2.1 From b4a6e61ec34d4a0db1110907cc969f0d7d38991a Mon Sep 17 00:00:00 2001 From: xuri Date: Wed, 12 Sep 2018 15:47:56 +0800 Subject: Fix golint errors under confidence 0.1 --- rows.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'rows.go') diff --git a/rows.go b/rows.go index 521a945..8e1e0c3 100644 --- a/rows.go +++ b/rows.go @@ -1,3 +1,11 @@ +// Package excelize providing a set of functions that allow you to write to +// and read from XLSX files. Support reads and writes XLSX file generated by +// Microsoft Excel™ 2007 and later. Support save file without losing original +// charts of XLSX. This library needs Go version 1.8 or later. +// +// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// this source code is governed by a BSD-style license that can be found in +// the LICENSE file. package excelize import ( -- cgit v1.2.1 From 2f146c923ccd19c5ecc1f732b5b09d591fb935a3 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 14 Sep 2018 00:35:47 +0800 Subject: Comments style changed. --- rows.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'rows.go') diff --git a/rows.go b/rows.go index 8e1e0c3..aa8b2a6 100644 --- a/rows.go +++ b/rows.go @@ -1,11 +1,13 @@ -// Package excelize providing a set of functions that allow you to write to -// and read from XLSX files. Support reads and writes XLSX file generated by -// Microsoft Excel™ 2007 and later. Support save file without losing original -// charts of XLSX. This library needs Go version 1.8 or later. -// -// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of -// this source code is governed by a BSD-style license that can be found in -// the LICENSE file. +/* +Package excelize providing a set of functions that allow you to write to +and read from XLSX files. Support reads and writes XLSX file generated by +Microsoft Excel™ 2007 and later. Support save file without losing original +charts of XLSX. This library needs Go version 1.8 or later. + +Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +this source code is governed by a BSD-style license that can be found in +the LICENSE file. +*/ package excelize import ( -- cgit v1.2.1 From 13a9769cc5bde486c52d8e45661ff8108cd786ae Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 14 Sep 2018 00:44:23 +0800 Subject: Comments style changed. --- rows.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'rows.go') diff --git a/rows.go b/rows.go index aa8b2a6..84dc6d8 100644 --- a/rows.go +++ b/rows.go @@ -1,13 +1,11 @@ -/* -Package excelize providing a set of functions that allow you to write to -and read from XLSX files. Support reads and writes XLSX file generated by -Microsoft Excel™ 2007 and later. Support save file without losing original -charts of XLSX. This library needs Go version 1.8 or later. - -Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of -this source code is governed by a BSD-style license that can be found in -the LICENSE file. -*/ +// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of +// this source code is governed by a BSD-style license that can be found in +// the LICENSE file. +// +// Package excelize providing a set of functions that allow you to write to +// and read from XLSX files. Support reads and writes XLSX file generated by +// Microsoft Excel™ 2007 and later. Support save file without losing original +// charts of XLSX. This library needs Go version 1.8 or later. package excelize import ( -- cgit v1.2.1 From 3e004d900b103379c2d62657a3070de4a2e8585a Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 14 Sep 2018 00:58:48 +0800 Subject: Comments style changed. --- rows.go | 1 + 1 file changed, 1 insertion(+) (limited to 'rows.go') diff --git a/rows.go b/rows.go index 84dc6d8..5c384c8 100644 --- a/rows.go +++ b/rows.go @@ -6,6 +6,7 @@ // and read from XLSX files. Support reads and writes XLSX file generated by // Microsoft Excel™ 2007 and later. Support save file without losing original // charts of XLSX. This library needs Go version 1.8 or later. + package excelize import ( -- cgit v1.2.1