Add workflows #14

Merged
fyrchik merged 1 commit from fyrchik/policy-engine:add-workflows into master 2024-09-04 19:51:23 +00:00
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) {