1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-10 02:00:24 +08:00

make lint happy

This commit is contained in:
源文雨
2023-02-23 15:04:09 +08:00
parent fa053fefd4
commit 958a125885
9 changed files with 54 additions and 116 deletions

View File

@@ -42,8 +42,7 @@ func (b *Body) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
return err
}
switch tt := t.(type) {
case xml.StartElement:
if tt, ok := t.(xml.StartElement); ok {
if tt.Name.Local == "p" {
var value Paragraph
err = d.DecodeElement(&value, &tt)
@@ -89,8 +88,7 @@ func (doc *Document) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
return err
}
switch tt := t.(type) {
case xml.StartElement:
if tt, ok := t.(xml.StartElement); ok {
if tt.Name.Local == "body" {
err = d.DecodeElement(&doc.Body, &tt)
if err != nil && !strings.HasPrefix(err.Error(), "expected") {