Skip to content

Commit

Permalink
Fixed lint (#200)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
  • Loading branch information
levb and hanzei authored Nov 2, 2022
1 parent 2d0aa71 commit 0f44cfb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 3 additions & 7 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,35 @@ linters-settings:
simplify: true
goimports:
local-prefixes: github.com/mattermost/mattermost-plugin-autolink
golint:
min-confidence: 0
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
misspell:
locale: US

linters:
disable-all: true
enable:
- bodyclose
- deadcode
- errcheck
- goconst
- gocritic
- gofmt
- goimports
- golint
- gosec
- gosimple
- govet
- ineffassign
- interfacer
- misspell
- revive
- nakedret
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace

issues:
Expand Down
6 changes: 3 additions & 3 deletions server/autolinkplugin/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func searchLinkRef(p *Plugin, requireUnique bool, args ...string) ([]autolink.Au
n, err := strconv.ParseUint(args[0], 10, 32)
if err == nil {
if n < 1 || int(n) > len(links) {
return nil, nil, errors.Errorf("%v is not a valid link number.", n)
return nil, nil, errors.Errorf("%v is not a valid link number", n)
}
return links, []int{int(n) - 1}, nil
}
Expand All @@ -349,7 +349,7 @@ func searchLinkRef(p *Plugin, requireUnique bool, args ...string) ([]autolink.Au
}
}
if len(found) == 0 {
return nil, nil, errors.Errorf("%q not found.", args[0])
return nil, nil, errors.Errorf("%q not found", args[0])
}
if requireUnique && len(found) > 1 {
names := []string{}
Expand Down Expand Up @@ -381,7 +381,7 @@ func searchLinkRefByTemplateOrPattern(p *Plugin, header *model.CommandArgs, args
}

if len(found) == 0 {
return nil, nil, errors.Errorf("%q not found.", value)
return nil, nil, errors.Errorf("%q not found", value)
}

return links, found, nil
Expand Down

0 comments on commit 0f44cfb

Please sign in to comment.