summaryrefslogtreecommitdiff
path: root/col.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2021-05-10 00:09:24 +0800
committerxuri <xuri.me@gmail.com>2021-05-10 00:09:24 +0800
commitbe12cc27f1d774154b17763c071e1dc6f91eab8c (patch)
treed6544c2e33e8aacfb0867e79ffc69fde435d3183 /col.go
parent423bc26d1f87db55bab5704afebf4509269bbc7e (diff)
This closes #652, new SetColWidth API, support set column width in stream writing mode, and export error message
Diffstat (limited to 'col.go')
-rw-r--r--col.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/col.go b/col.go
index 09a172a..e1ac5a5 100644
--- a/col.go
+++ b/col.go
@@ -14,7 +14,6 @@ package excelize
import (
"bytes"
"encoding/xml"
- "errors"
"math"
"strconv"
"strings"
@@ -360,7 +359,7 @@ func (f *File) parseColRange(columns string) (start, end int, err error) {
//
func (f *File) SetColOutlineLevel(sheet, col string, level uint8) error {
if level > 7 || level < 1 {
- return errors.New("invalid outline level")
+ return ErrOutlineLevel
}
colNum, err := ColumnNameToNumber(col)
if err != nil {
@@ -452,7 +451,7 @@ func (f *File) SetColWidth(sheet, startcol, endcol string, width float64) error
return err
}
if width > MaxColumnWidth {
- return errors.New("the width of the column must be smaller than or equal to 255 characters")
+ return ErrColumnWidth
}
if min > max {
min, max = max, min