From 5eee1a733432209bd313944ee56a4b8fec8231e9 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 1 Nov 2023 11:19:30 +0300 Subject: [PATCH] [#14] pre-commit: Add gofumpt Signed-off-by: Evgenii Stratonikov --- .golangci.yml | 2 +- Makefile | 2 +- chain.go | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index dba7f0c..e10866d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -47,7 +47,7 @@ linters: - durationcheck - exhaustive - exportloopref - - gofmt + - gofumpt - goimports - misspell - whitespace diff --git a/Makefile b/Makefile index 1f0c585..debad31 100755 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ fmts: fmt imports # Reformat code fmt: @echo "⇒ Processing gofmt check" - @gofmt -s -w . + @gofumpt -s -w . # Reformat imports imports: diff --git a/chain.go b/chain.go index 938854d..6bb263d 100644 --- a/chain.go +++ b/chain.go @@ -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) {