summaryrefslogtreecommitdiff
path: root/lib.go
diff options
context:
space:
mode:
authorMJacred <loesch.benny92@gmx.de>2022-07-14 17:36:43 +0200
committerGitHub <noreply@github.com>2022-07-14 23:36:43 +0800
commit6429588e1448f70539774a88840f094829cb9e07 (patch)
treebe54a60658885cfb27d037f06af457dda5644c3a /lib.go
parente37724c22b95de974f0235e992236d555aa6ad12 (diff)
adjust `ErrColumnNumber`, rename `TotalColumns` to `MaxColumns` and add new constant `MinColumns` (#1272)
Signed-off-by: Benjamin Lösch <loesch.benny92@gmx.de>
Diffstat (limited to 'lib.go')
-rw-r--r--lib.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib.go b/lib.go
index f285a40..3170a6d 100644
--- a/lib.go
+++ b/lib.go
@@ -211,7 +211,7 @@ func ColumnNameToNumber(name string) (int, error) {
}
multi *= 26
}
- if col > TotalColumns {
+ if col > MaxColumns {
return -1, ErrColumnNumber
}
return col, nil
@@ -225,10 +225,7 @@ func ColumnNameToNumber(name string) (int, error) {
// excelize.ColumnNumberToName(37) // returns "AK", nil
//
func ColumnNumberToName(num int) (string, error) {
- if num < 1 {
- return "", fmt.Errorf("incorrect column number %d", num)
- }
- if num > TotalColumns {
+ if num < MinColumns || num > MaxColumns {
return "", ErrColumnNumber
}
var col string