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

make lint happy

This commit is contained in:
源文雨
2023-02-23 15:22:56 +08:00
parent 958a125885
commit b9c9164250
14 changed files with 76 additions and 38 deletions

View File

@@ -7,11 +7,14 @@ import (
// Text object contains the actual text
type Text struct {
XMLName xml.Name `xml:"w:t,omitempty"`
XMLSpace string `xml:"xml:space,attr,omitempty"`
Text string `xml:",chardata"`
XMLName xml.Name `xml:"w:t,omitempty"`
// XMLSpace string `xml:"xml:space,attr,omitempty"`
Text string `xml:",chardata"`
}
// UnmarshalXML ...
func (r *Text) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
for {
t, err := d.Token()
@@ -22,8 +25,7 @@ func (r *Text) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
return err
}
switch tt := t.(type) {
case xml.CharData:
if tt, ok := t.(xml.CharData); ok {
r.Text = string(tt) // implicitly copy
}