Skip to content

Commit

Permalink
Fix linter errors (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzei authored Oct 14, 2022
1 parent 2619c30 commit 735ed7a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 16 deletions.
17 changes: 3 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,49 @@ run:
modules-download-mode: readonly

linters-settings:
goconst:
min-len: 2
min-occurrences: 2
gofmt:
simplify: true
goimports:
local-prefixes: github.com/mattermost/mattermost-plugin-confluence
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
- nakedret
- revive
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- varcheck
- whitespace

issues:
exclude-rules:
- path: server/manifest.go
linters:
- deadcode
- unused
- varcheck
- path: server/configuration.go
linters:
- unused
- path: _test\.go
linters:
- bodyclose
- goconst
- scopelint # https://github.com/kyoh86/scopelint/issues/4
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ require (
github.com/stretchr/testify v1.6.1
github.com/thoas/go-funk v0.6.0
go.uber.org/atomic v1.6.0
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec // indirect
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,9 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec h1:BkDtF2Ih9xZ7le9ndzTA7KJow28VbQW3odyk/8drmuI=
golang.org/x/sys v0.0.0-20220928140112-f11e5e49a4ec/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
5 changes: 4 additions & 1 deletion server/service/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func getNotificationChannelIDs(url, spaceKey, pageID, eventType string) []string
}
}

channelIDs := append(urlSpaceKeySubscriptionChannelIDs, urlPageIDSubscriptionChannelIDs...)
var channelIDs []string
channelIDs = append(channelIDs, urlSpaceKeySubscriptionChannelIDs...)
channelIDs = append(channelIDs, urlPageIDSubscriptionChannelIDs...)

return util.Deduplicate(channelIDs)
}

0 comments on commit 735ed7a

Please sign in to comment.