Skip to content

Commit

Permalink
pin golangci-lint version to latest available, fix reported errors
Browse files Browse the repository at this point in the history
  • Loading branch information
paskal committed May 10, 2024
1 parent c193d11 commit 67ebd24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
version: v1.58

- name: install goveralls
run: go install github.com/mattn/goveralls@latest
Expand Down
23 changes: 12 additions & 11 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0.8
enable:
- shadow
gocyclo:
min-complexity: 15
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
Expand All @@ -30,13 +27,12 @@ linters:
disable-all: true
enable:
- bodyclose
- megacheck
- revive
- govet
- unconvert
- megacheck
- staticcheck
- unused
- gas
- gosec
- misspell
- unparam
- typecheck
Expand All @@ -52,17 +48,22 @@ linters:
fast: false

run:
modules-download-mode: vendor
skip-dirs:
- vendor
concurrency: 4

issues:
exclude-dirs:
- vendor
exclude-rules:
- text: "weak cryptographic primitive"
linters:
- gosec
- text: "package-comments: should have a package comment"
linters:
- revive
- linters:
- unparam
- unused
- revive
path: _test\.go$
text: "unused-parameter"
exclude-use-default: false
2 changes: 1 addition & 1 deletion app/server/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Logger(l log.L, flags ...LoggerFlag) func(http.Handler) http.Handler {
result = string(content)
r.Body = io.NopCloser(bytes.NewReader(content))

if len(result) > 0 {
if result != "" {
result = strings.Replace(result, "\n", " ", -1)
result = reMultWhtsp.ReplaceAllString(result, " ")
}
Expand Down

0 comments on commit 67ebd24

Please sign in to comment.