From 324f87bcaed9ec775c0b79627956a093ad481d36 Mon Sep 17 00:00:00 2001 From: xuri Date: Fri, 18 Sep 2020 22:20:58 +0800 Subject: add checking and limits for the worksheet --- col.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'col.go') diff --git a/col.go b/col.go index 72db4be..19ce99b 100644 --- a/col.go +++ b/col.go @@ -444,6 +444,9 @@ func (f *File) SetColWidth(sheet, startcol, endcol string, width float64) error if err != nil { return err } + if width > MaxColumnWidth { + return errors.New("the width of the column must be smaller than or equal to 255 characters") + } if min > max { min, max = max, min } -- cgit v1.2.1