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

chore: make lint happy

This commit is contained in:
源文雨
2025-05-06 17:45:49 +09:00
parent 4dea62ceaa
commit c6b0eac317
4 changed files with 6 additions and 6 deletions

View File

@@ -25,9 +25,9 @@ linters:
- copyloopvar - copyloopvar
- exhaustive - exhaustive
#- funlen #- funlen
- goconst #- goconst
- gocritic - gocritic
- gocyclo #- gocyclo
#- gofumpt #- gofumpt
#- goimports #- goimports
- goprintffuncname - goprintffuncname

View File

@@ -165,7 +165,7 @@ func main() {
if err != nil { if err != nil {
panic(err) panic(err)
} }
fmt.Println("Document writen. \nNow trying to read it") fmt.Println("Document written. \nNow trying to read it")
} }
// Now let's try to read the file // Now let's try to read the file

View File

@@ -283,7 +283,7 @@ func (r *WPInline) String() string {
return "![inln?](unknown)" return "![inln?](unknown)"
} }
func (r *WPInline) copymedia(to *Docx) *WPInline { func (r *WPInline) copymedia(to *Docx) *WPInline { //nolint: dupl
if r.Graphic.GraphicData.Pic != nil { if r.Graphic.GraphicData.Pic != nil {
if r.Graphic.GraphicData.Pic.BlipFill != nil { if r.Graphic.GraphicData.Pic.BlipFill != nil {
tgt, err := r.file.ReferTarget(r.Graphic.GraphicData.Pic.BlipFill.Blip.Embed) tgt, err := r.file.ReferTarget(r.Graphic.GraphicData.Pic.BlipFill.Blip.Embed)
@@ -1373,7 +1373,7 @@ func (r *WPAnchor) String() string {
return "![anch?](unknown)" return "![anch?](unknown)"
} }
func (r *WPAnchor) copymedia(to *Docx) *WPAnchor { func (r *WPAnchor) copymedia(to *Docx) *WPAnchor { //nolint: dupl
if r.Graphic.GraphicData.Pic != nil { if r.Graphic.GraphicData.Pic != nil {
if r.Graphic.GraphicData.Pic.BlipFill != nil { if r.Graphic.GraphicData.Pic.BlipFill != nil {
tgt, err := r.file.ReferTarget(r.Graphic.GraphicData.Pic.BlipFill.Blip.Embed) tgt, err := r.file.ReferTarget(r.Graphic.GraphicData.Pic.BlipFill.Blip.Embed)

View File

@@ -32,7 +32,7 @@ func (f *Docx) UseTemplate(template string, tmpfslst []string, tmplfs fs.FS) *Do
return f return f
} }
// WithDefaultTheme use default theme embeded // WithDefaultTheme use default theme embedded
func (f *Docx) WithDefaultTheme() *Docx { func (f *Docx) WithDefaultTheme() *Docx {
return f.UseTemplate("default", DefaultTemplateFilesList, TemplateXMLFS) return f.UseTemplate("default", DefaultTemplateFilesList, TemplateXMLFS)
} }