From 44a13aa402b0189b119635d2f0a26961795c6bda Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 7 Dec 2021 00:26:53 +0800 Subject: Export 7 errors so users can act differently on different type of errors --- file.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'file.go') diff --git a/file.go b/file.go index a430c5f..e2aeb4a 100644 --- a/file.go +++ b/file.go @@ -14,7 +14,6 @@ package excelize import ( "archive/zip" "bytes" - "fmt" "io" "os" "path/filepath" @@ -58,7 +57,7 @@ func NewFile() *File { // Save provides a function to override the spreadsheet with origin path. func (f *File) Save() error { if f.Path == "" { - return fmt.Errorf("no path defined for file, consider File.WriteTo or File.Write") + return ErrSave } return f.SaveAs(f.Path) } -- cgit v1.2.1