diff options
author | xuri <xuri.me@gmail.com> | 2021-04-30 00:14:42 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2021-04-30 00:14:42 +0800 |
commit | 7e429c5b464b53f305e94cc355f14ba9e1d9849c (patch) | |
tree | c732503f48464b6303291d2538f80d170c4bc913 /stream.go | |
parent | af5e87dbcf5a89201072f5ca07d532258ece278f (diff) |
Fixe issue generated file corrupted caused by incorrect default XML namespace attributes
Diffstat (limited to 'stream.go')
-rw-r--r-- | stream.go | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -40,8 +40,9 @@ type StreamWriter struct { // generate new worksheet with large amounts of data. Note that after set // rows, you must call the 'Flush' method to end the streaming writing // process and ensure that the order of line numbers is ascending, the common -// API and stream API can't be work mixed to writing data on the worksheets. -// For example, set data for worksheet of size 102400 rows x 50 columns with +// API and stream API can't be work mixed to writing data on the worksheets, +// you can't get cell value when in-memory chunks data over 16MB. For +// example, set data for worksheet of size 102400 rows x 50 columns with // numbers and style: // // file := excelize.NewFile() @@ -111,7 +112,7 @@ func (f *File) NewStreamWriter(sheet string) (*StreamWriter, error) { // AddTable creates an Excel table for the StreamWriter using the given // coordinate area and format set. For example, create a table of A1:D5: // -// err := sw.AddTable("A1", "D5", ``) +// err := sw.AddTable("A1", "D5", "") // // Create a table of F2:H6 with format set: // @@ -500,8 +501,7 @@ func (bw *bufferedWriter) Reader() (io.Reader, error) { // buffer has grown large enough. Any error will be returned. func (bw *bufferedWriter) Sync() (err error) { // Try to use local storage - const chunk = 1 << 24 - if bw.buf.Len() < chunk { + if bw.buf.Len() < StreamChunkSize { return nil } if bw.tmp == nil { |