Skip to content

Commit

Permalink
feat: add fileName validation
Browse files Browse the repository at this point in the history
  • Loading branch information
VarusHsu committed Jan 29, 2024
1 parent f30ef40 commit 22b73b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ type Option func(*options)
// different sheetModel better have different sheet name to avoid confusion
// rows ordered in Excel file is the same as sheetModels
func WriteExcelSaveAs(fileName string, sheetModels []SheetModel, opts ...Option) error {
if fileName == "" {
return errors.New("fileName can not be empty")
}
f, err := write(sheetModels, opts...)
if err != nil {
return err
Expand Down
Binary file modified test.xlsx
Binary file not shown.

0 comments on commit 22b73b0

Please sign in to comment.