From 6429588e1448f70539774a88840f094829cb9e07 Mon Sep 17 00:00:00 2001 From: MJacred Date: Thu, 14 Jul 2022 17:36:43 +0200 Subject: adjust `ErrColumnNumber`, rename `TotalColumns` to `MaxColumns` and add new constant `MinColumns` (#1272) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Benjamin Lösch --- stream.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'stream.go') diff --git a/stream.go b/stream.go index 641340e..0db2438 100644 --- a/stream.go +++ b/stream.go @@ -387,10 +387,7 @@ func (sw *StreamWriter) SetColWidth(min, max int, width float64) error { if sw.sheetWritten { return ErrStreamSetColWidth } - if min > TotalColumns || max > TotalColumns { - return ErrColumnNumber - } - if min < 1 || max < 1 { + if min < MinColumns || min > MaxColumns || max < MinColumns || max > MaxColumns { return ErrColumnNumber } if width > MaxColumnWidth { -- cgit v1.2.1