1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-04 23:30:25 +08:00

make lint happy

This commit is contained in:
源文雨
2023-03-30 22:13:01 +08:00
parent c95683a4ee
commit f241cc1484
4 changed files with 8 additions and 7 deletions

View File

@@ -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

View File

@@ -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
}

View File

@@ -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 {

View File

@@ -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
}