[#14] pre-commit: Add gofumpt
DCO action / DCO (pull_request) Successful in 57s Details
Tests and linters / Tests (1.20) (pull_request) Successful in 1m9s Details
Tests and linters / Staticcheck (pull_request) Successful in 1m21s Details
Tests and linters / Tests with -race (pull_request) Successful in 1m27s Details
Tests and linters / Lint (pull_request) Successful in 2m8s Details
Tests and linters / Tests (1.21) (pull_request) Successful in 2m36s Details

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
pull/14/head
Evgenii Stratonikov 2023-11-01 11:19:30 +03:00
parent 8dc9d9fa58
commit 5eee1a7334
3 changed files with 4 additions and 2 deletions

View File

@ -47,7 +47,7 @@ linters:
- durationcheck
- exhaustive
- exportloopref
- gofmt
- gofumpt
- goimports
- misspell
- whitespace

View File

@ -12,7 +12,7 @@ fmts: fmt imports
# Reformat code
fmt:
@echo "⇒ Processing gofmt check"
@gofmt -s -w .
@gofumpt -s -w .
# Reformat imports
imports:

View File

@ -150,6 +150,7 @@ func (r *Rule) matchCondition(obj Request) (status Status, matched bool) {
}
return r.matchAll(obj)
}
func (r *Rule) matchAny(obj Request) (status Status, matched bool) {
for i := range r.Condition {
if r.Condition[i].Match(obj) {
@ -158,6 +159,7 @@ func (r *Rule) matchAny(obj Request) (status Status, matched bool) {
}
return NoRuleFound, false
}
func (r *Rule) matchAll(obj Request) (status Status, matched bool) {
for i := range r.Condition {
if !r.Condition[i].Match(obj) {