Skip to content

Commit b4a6e61

Browse files
committed
Fix golint errors under confidence 0.1
1 parent 99c9d04 commit b4a6e61

32 files changed

+319
-69
lines changed

cell.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

chart.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

col.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

comment.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

datavalidation.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (
@@ -128,7 +136,7 @@ func (dd *DataValidation) SetSqrefDropList(sqref string, isCurrentSheet bool) er
128136
}
129137

130138
//isCurrentSheet = false Cross-sheet sqref cell use extLst xml node unrealized
131-
return fmt.Errorf("Cross-sheet sqref cell are not supported")
139+
return fmt.Errorf("cross-sheet sqref cell are not supported")
132140
}
133141

134142
// SetSqref provides function to set data validation range in drop list.

datavalidation_test.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

date.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

excelize.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

file.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (
@@ -43,7 +51,7 @@ func NewFile() *File {
4351
// Save provides a function to override the xlsx file with origin path.
4452
func (f *File) Save() error {
4553
if f.Path == "" {
46-
return fmt.Errorf("No path defined for file, consider File.WriteTo or File.Write")
54+
return fmt.Errorf("no path defined for file, consider File.WriteTo or File.Write")
4755
}
4856
return f.SaveAs(f.Path)
4957
}

hsl.go

+32-30
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
1-
/*
2-
Copyright (c) 2012 Rodrigo Moraes. All rights reserved.
3-
4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions are
6-
met:
7-
8-
* Redistributions of source code must retain the above copyright
9-
notice, this list of conditions and the following disclaimer.
10-
* Redistributions in binary form must reproduce the above
11-
copyright notice, this list of conditions and the following disclaimer
12-
in the documentation and/or other materials provided with the
13-
distribution.
14-
* Neither the name of Google Inc. nor the names of its
15-
contributors may be used to endorse or promote products derived from
16-
this software without specific prior written permission.
17-
18-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29-
*/
30-
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright (c) 2012 Rodrigo Moraes. All rights reserved.
7+
//
8+
// Redistribution and use in source and binary forms, with or without
9+
// modification, are permitted provided that the following conditions are
10+
// met:
11+
//
12+
// * Redistributions of source code must retain the above copyright
13+
// notice, this list of conditions and the following disclaimer.
14+
// * Redistributions in binary form must reproduce the above
15+
// copyright notice, this list of conditions and the following disclaimer
16+
// in the documentation and/or other materials provided with the
17+
// distribution.
18+
// * Neither the name of Google Inc. nor the names of its
19+
// contributors may be used to endorse or promote products derived from
20+
// this software without specific prior written permission.
21+
//
22+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24+
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25+
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26+
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27+
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28+
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29+
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3133
package excelize
3234

3335
import (

lib.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

picture.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (
@@ -86,10 +94,10 @@ func (f *File) AddPicture(sheet, cell, picture, format string) error {
8694
}
8795
ext, ok := supportImageTypes[path.Ext(picture)]
8896
if !ok {
89-
return errors.New("Unsupported image extension")
97+
return errors.New("unsupported image extension")
9098
}
9199
readFile, err := os.Open(picture)
92-
if err!=nil{
100+
if err != nil {
93101
return err
94102
}
95103
defer readFile.Close()

rows.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

shape.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (

sheet.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (
@@ -371,7 +379,7 @@ func (f *File) SetSheetBackground(sheet, picture string) error {
371379
}
372380
ext, ok := supportImageTypes[path.Ext(picture)]
373381
if !ok {
374-
return errors.New("Unsupported image extension")
382+
return errors.New("unsupported image extension")
375383
}
376384
pictureID := f.countMedia() + 1
377385
rID := f.addSheetRelationships(sheet, SourceRelationshipImage, "../media/image"+strconv.Itoa(pictureID)+ext, "")
@@ -441,7 +449,7 @@ func (f *File) deleteSheetFromContentTypes(target string) {
441449
//
442450
func (f *File) CopySheet(from, to int) error {
443451
if from < 1 || to < 1 || from == to || f.GetSheetName(from) == "" || f.GetSheetName(to) == "" {
444-
return errors.New("Invalid worksheet index")
452+
return errors.New("invalid worksheet index")
445453
}
446454
f.copySheet(from, to)
447455
return nil

sheetpr.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
// SheetPrOption is an option of a view of a worksheet. See SetSheetPrOptions().

sheetview.go

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import "fmt"

styles.go

+36-28
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Package excelize providing a set of functions that allow you to write to
2+
// and read from XLSX files. Support reads and writes XLSX file generated by
3+
// Microsoft Excel™ 2007 and later. Support save file without losing original
4+
// charts of XLSX. This library needs Go version 1.8 or later.
5+
//
6+
// Copyright 2016 - 2018 The excelize Authors. All rights reserved. Use of
7+
// this source code is governed by a BSD-style license that can be found in
8+
// the LICENSE file.
19
package excelize
210

311
import (
@@ -798,35 +806,35 @@ var validType = map[string]string{
798806

799807
// criteriaType defined the list of valid criteria types.
800808
var criteriaType = map[string]string{
801-
"between": "between",
802-
"not between": "notBetween",
803-
"equal to": "equal",
804-
"=": "equal",
805-
"==": "equal",
806-
"not equal to": "notEqual",
807-
"!=": "notEqual",
808-
"<>": "notEqual",
809-
"greater than": "greaterThan",
810-
">": "greaterThan",
811-
"less than": "lessThan",
812-
"<": "lessThan",
809+
"between": "between",
810+
"not between": "notBetween",
811+
"equal to": "equal",
812+
"=": "equal",
813+
"==": "equal",
814+
"not equal to": "notEqual",
815+
"!=": "notEqual",
816+
"<>": "notEqual",
817+
"greater than": "greaterThan",
818+
">": "greaterThan",
819+
"less than": "lessThan",
820+
"<": "lessThan",
813821
"greater than or equal to": "greaterThanOrEqual",
814-
">=": "greaterThanOrEqual",
815-
"less than or equal to": "lessThanOrEqual",
816-
"<=": "lessThanOrEqual",
817-
"containing": "containsText",
818-
"not containing": "notContains",
819-
"begins with": "beginsWith",
820-
"ends with": "endsWith",
821-
"yesterday": "yesterday",
822-
"today": "today",
823-
"last 7 days": "last7Days",
824-
"last week": "lastWeek",
825-
"this week": "thisWeek",
826-
"continue week": "continueWeek",
827-
"last month": "lastMonth",
828-
"this month": "thisMonth",
829-
"continue month": "continueMonth",
822+
">=": "greaterThanOrEqual",
823+
"less than or equal to": "lessThanOrEqual",
824+
"<=": "lessThanOrEqual",
825+
"containing": "containsText",
826+
"not containing": "notContains",
827+
"begins with": "beginsWith",
828+
"ends with": "endsWith",
829+
"yesterday": "yesterday",
830+
"today": "today",
831+
"last 7 days": "last7Days",
832+
"last week": "lastWeek",
833+
"this week": "thisWeek",
834+
"continue week": "continueWeek",
835+
"last month": "lastMonth",
836+
"this month": "thisMonth",
837+
"continue month": "continueMonth",
830838
}
831839

832840
// formatToString provides a function to return original string by given

0 commit comments

Comments
 (0)