diff --git a/docx.go b/docx.go index 1e3e04f..b0e6a00 100644 --- a/docx.go +++ b/docx.go @@ -27,6 +27,7 @@ import ( "encoding/xml" "io" "io/fs" + "os" "sync" ) @@ -156,8 +157,8 @@ func (f *Docx) WriteTo(writer io.Writer) (_ int64, err error) { } // Read is a fake function and cannot be used -func (f *Docx) Read(p []byte) (n int, err error) { - panic("fake stub!") +func (f *Docx) Read(_ []byte) (int, error) { + return 0, os.ErrInvalid } // UseTemplate will replace template files diff --git a/pack.go b/pack.go index 5c96372..1927976 100644 --- a/pack.go +++ b/pack.go @@ -79,7 +79,7 @@ type marshaller struct { } // Read is fake and is to trigger io.WriterTo -func (m marshaller) Read(p []byte) (n int, err error) { +func (m marshaller) Read(_ []byte) (int, error) { return 0, os.ErrInvalid } diff --git a/structgroup.go b/structgroup.go index 5941dca..725515d 100644 --- a/structgroup.go +++ b/structgroup.go @@ -37,7 +37,7 @@ type WordprocessingGroup struct { } // UnmarshalXML ... -func (w *WordprocessingGroup) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { +func (w *WordprocessingGroup) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error { for { t, err := d.Token() if err == io.EOF { @@ -113,7 +113,7 @@ type WPGcNvGrpSpPr struct { } // UnmarshalXML ... -func (w *WPGcNvGrpSpPr) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { +func (w *WPGcNvGrpSpPr) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error { for { t, err := d.Token() if err == io.EOF { @@ -160,7 +160,7 @@ type WPGGroupShape struct { } // UnmarshalXML ... -func (w *WPGGroupShape) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { +func (w *WPGGroupShape) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error { for { t, err := d.Token() if err == io.EOF { diff --git a/structtext.go b/structtext.go index abea6fe..7a598a0 100644 --- a/structtext.go +++ b/structtext.go @@ -134,7 +134,7 @@ func (r *Text) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { type RunMergeRule func(r1, r2 *Run) bool // MergeAllRuns ... -func MergeAllRuns(r1, r2 *Run) bool { +func MergeAllRuns(_, _ *Run) bool { return true }