diff options
author | xuri <xuri.me@gmail.com> | 2019-12-16 08:32:04 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-12-16 08:32:04 +0800 |
commit | a526e90404913f5d649d29a7aeee29f5ac9ff590 (patch) | |
tree | 6f502897cf2083935d6e8842a06146de303e7c98 /stream.go | |
parent | 3763228ea7c37e18633ada493a63a6a8722e508c (diff) |
Fix #426, handle empty workbook view
Diffstat (limited to 'stream.go')
-rw-r--r-- | stream.go | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -191,13 +191,12 @@ func StreamMarshalSheet(ws *xlsxWorksheet, replaceMap map[string][]byte) []byte var marshalResult []byte marshalResult = append(marshalResult, []byte(XMLHeader+`<worksheet`+templateNamespaceIDMap)...) for i := 0; i < s.NumField(); i++ { - f := s.Field(i) content, ok := replaceMap[typeOfT.Field(i).Name] if ok { marshalResult = append(marshalResult, content...) continue } - out, _ := xml.Marshal(f.Interface()) + out, _ := xml.Marshal(s.Field(i).Interface()) marshalResult = append(marshalResult, out...) } marshalResult = append(marshalResult, []byte(`</worksheet>`)...) |