From bf4e9431b458e9a39f7cfc71351f48e8219cee60 Mon Sep 17 00:00:00 2001 From: guoqiang Date: Wed, 25 Dec 2024 15:55:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=A7=E5=B0=8F?= =?UTF-8?q?=E5=86=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apipara.go | 6 +++--- structnum.go | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apipara.go b/apipara.go index e5ac319..ed146ba 100644 --- a/apipara.go +++ b/apipara.go @@ -80,7 +80,7 @@ func (p *Paragraph) Style(val string) *Paragraph { } // NumPr number properties -func (p *Paragraph) NumPr(numId, ilvl string) *Paragraph { +func (p *Paragraph) NumPr(numID, ilvl string) *Paragraph { if p.Properties == nil { p.Properties = &ParagraphProperties{} } @@ -89,8 +89,8 @@ func (p *Paragraph) NumPr(numId, ilvl string) *Paragraph { p.Properties.RunProperties = &RunProperties{} } p.Properties.NumProperties = &NumProperties{ - NumId: &NumId{ - Val: numId, + NumID: &NumID{ + Val: numID, }, Ilvl: &Ilevel{ Val: ilvl, diff --git a/structnum.go b/structnum.go index 1a119ac..b0c9bb6 100644 --- a/structnum.go +++ b/structnum.go @@ -8,12 +8,12 @@ import ( // NumProperties show the number properties type NumProperties struct { XMLName xml.Name `xml:"w:numPr,omitempty"` - NumId *NumId + NumID *NumID Ilvl *Ilevel } -// NumId show the number id -type NumId struct { +// NumID show the number id +type NumID struct { XMLName xml.Name `xml:"w:numId,omitempty"` Val string `xml:"w:val,attr"` } @@ -38,9 +38,9 @@ func (n *NumProperties) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error { if tt, ok := t.(xml.StartElement); ok { switch tt.Name.Local { case "numId": - var value NumId + var value NumID value.Val = getAtt(tt.Attr, "val") - n.NumId = &value + n.NumID = &value case "ilvl": var value Ilevel value.Val = getAtt(tt.Attr, "val")