From be12cc27f1d774154b17763c071e1dc6f91eab8c Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 10 May 2021 00:09:24 +0800 Subject: This closes #652, new SetColWidth API, support set column width in stream writing mode, and export error message --- adjust.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'adjust.go') diff --git a/adjust.go b/adjust.go index e06d4f6..28b62cc 100644 --- a/adjust.go +++ b/adjust.go @@ -12,7 +12,6 @@ package excelize import ( - "errors" "strings" ) @@ -219,7 +218,7 @@ func areaRangeToCoordinates(firstCell, lastCell string) ([]int, error) { // correct C1:B3 to B1:C3. func sortCoordinates(coordinates []int) error { if len(coordinates) != 4 { - return errors.New("coordinates length must be 4") + return ErrCoordinates } if coordinates[2] < coordinates[0] { coordinates[2], coordinates[0] = coordinates[0], coordinates[2] @@ -234,7 +233,7 @@ func sortCoordinates(coordinates []int) error { // to area reference. func (f *File) coordinatesToAreaRef(coordinates []int) (string, error) { if len(coordinates) != 4 { - return "", errors.New("coordinates length must be 4") + return "", ErrCoordinates } firstCell, err := CoordinatesToCellName(coordinates[0], coordinates[1]) if err != nil { -- cgit v1.2.1