1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-13 12:20:30 +08:00

make lint happy

This commit is contained in:
源文雨
2023-02-24 15:56:28 +08:00
parent eef86484df
commit 3c912b94d5

View File

@@ -417,7 +417,7 @@ type WTableCell struct {
} }
// UnmarshalXML ... // UnmarshalXML ...
func (r *WTableCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { func (c *WTableCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
for { for {
t, err := d.Token() t, err := d.Token()
if err == io.EOF { if err == io.EOF {
@@ -436,10 +436,10 @@ func (r *WTableCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
return err return err
} }
if len(value.Children) > 0 { if len(value.Children) > 0 {
value.file = r.file value.file = c.file
r.mu.Lock() c.mu.Lock()
r.Paragraphs = append(r.Paragraphs, value) c.Paragraphs = append(c.Paragraphs, value)
r.mu.Unlock() c.mu.Unlock()
} }
case "tcPr": case "tcPr":
var value WTableCellProperties var value WTableCellProperties
@@ -447,7 +447,7 @@ func (r *WTableCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
if err != nil && !strings.HasPrefix(err.Error(), "expected") { if err != nil && !strings.HasPrefix(err.Error(), "expected") {
return err return err
} }
r.TableCellProperties = &value c.TableCellProperties = &value
default: default:
err = d.Skip() // skip unsupported tags err = d.Skip() // skip unsupported tags
if err != nil { if err != nil {
@@ -623,6 +623,7 @@ type WTableBorder struct {
Color string `xml:"w:color,attr"` Color string `xml:"w:color,attr"`
} }
// UnmarshalXML ...
func (t *WTableBorder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { func (t *WTableBorder) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
for _, attr := range start.Attr { for _, attr := range start.Attr {
switch attr.Name.Local { switch attr.Name.Local {