From 36b7990d6ba1036823abf7a01ec8cf74509d4910 Mon Sep 17 00:00:00 2001 From: xuri Date: Mon, 15 Feb 2021 00:09:35 +0800 Subject: lint issue fixed and new formula function: ATAN, AVERAGE, AVERAGEA, CONCAT, CONCATENATE, COUNT, COUNTBLANK, MAX --- stream.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'stream.go') diff --git a/stream.go b/stream.go index e2f7935..f5fda9d 100644 --- a/stream.go +++ b/stream.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2021 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // @@ -93,9 +93,9 @@ func (f *File) NewStreamWriter(sheet string) (*StreamWriter, error) { } f.streams[sheetXML] = sw - sw.rawData.WriteString(XMLHeader + ``) + _, _ = sw.rawData.WriteString(``) return sw, err } @@ -184,7 +184,7 @@ func (sw *StreamWriter) AddTable(hcell, vcell, format string) error { tableXML := strings.Replace(sheetRelationshipsTableXML, "..", "xl", -1) // Add first table for given sheet. - sheetPath, _ := sw.File.sheetMap[trimSheetName(sw.Sheet)] + sheetPath := sw.File.sheetMap[trimSheetName(sw.Sheet)] sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(sheetPath, "xl/worksheets/") + ".rels" rID := sw.File.addRels(sheetRels, SourceRelationshipTable, sheetRelationshipsTableXML, "") @@ -296,12 +296,12 @@ func (sw *StreamWriter) SetRow(axis string, values []interface{}) error { val = v.Value } if err = setCellValFunc(&c, val); err != nil { - sw.rawData.WriteString(``) + _, _ = sw.rawData.WriteString(``) return err } writeCell(&sw.rawData, c) } - sw.rawData.WriteString(``) + _, _ = sw.rawData.WriteString(``) return sw.rawData.Sync() } @@ -361,7 +361,7 @@ func setCellIntFunc(c *xlsxC, val interface{}) (err error) { } func writeCell(buf *bufferedWriter, c xlsxC) { - buf.WriteString(``) + _, _ = buf.WriteString(`>`) if c.V != "" { - buf.WriteString(``) - xml.EscapeText(buf, []byte(c.V)) - buf.WriteString(``) + _, _ = buf.WriteString(``) + _ = xml.EscapeText(buf, []byte(c.V)) + _, _ = buf.WriteString(``) } - buf.WriteString(``) + _, _ = buf.WriteString(``) } // Flush ending the streaming writing process. func (sw *StreamWriter) Flush() error { - sw.rawData.WriteString(``) + _, _ = sw.rawData.WriteString(``) bulkAppendFields(&sw.rawData, sw.worksheet, 8, 38) - sw.rawData.WriteString(sw.tableParts) + _, _ = sw.rawData.WriteString(sw.tableParts) bulkAppendFields(&sw.rawData, sw.worksheet, 40, 40) - sw.rawData.WriteString(``) + _, _ = sw.rawData.WriteString(``) if err := sw.rawData.Flush(); err != nil { return err } @@ -407,7 +407,7 @@ func bulkAppendFields(w io.Writer, ws *xlsxWorksheet, from, to int) { enc := xml.NewEncoder(w) for i := 0; i < s.NumField(); i++ { if from <= i && i <= to { - enc.Encode(s.Field(i).Interface()) + _ = enc.Encode(s.Field(i).Interface()) } } } -- cgit v1.2.1