Skip to content

Commit

Permalink
Merge pull request qax-os#141 from WingGao/wing
Browse files Browse the repository at this point in the history
fix OpenReader no sheet error
  • Loading branch information
xuri authored Nov 3, 2017
2 parents f10ee92 + 48b8bac commit a4ffb4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions excelize.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ func OpenFile(filename string) (*File, error) {
return nil, err
}
f.Path = filename
f.sheetMap = f.getSheetMap()
f.Styles = f.stylesReader()
return f, nil
}

Expand All @@ -60,12 +58,15 @@ func OpenReader(r io.Reader) (*File, error) {
if err != nil {
return nil, err
}
return &File{
f := &File{
checked: make(map[string]bool),
Sheet: make(map[string]*xlsxWorksheet),
SheetCount: sheetCount,
XLSX: file,
}, nil
}
f.sheetMap = f.getSheetMap()
f.Styles = f.stylesReader()
return f, nil
}

// setDefaultTimeStyle provides function to set default numbers format for
Expand Down

0 comments on commit a4ffb4f

Please sign in to comment.