diff options
Diffstat (limited to 'col.go')
-rw-r--r-- | col.go | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -199,8 +199,11 @@ func (f *File) Cols(sheet string) (*Cols, error) { if !ok { return nil, ErrSheetNotExist{sheet} } - if f.Sheet[name] != nil { - output, _ := xml.Marshal(f.Sheet[name]) + if ws, ok := f.Sheet.Load(name); ok && ws != nil { + worksheet := ws.(*xlsxWorksheet) + worksheet.Lock() + defer worksheet.Unlock() + output, _ := xml.Marshal(worksheet) f.saveFileList(name, f.replaceNameSpaceBytes(name, output)) } var colIterator columnXMLIterator |