From 9143b60294d9aa2051d5aa0c6575453183123243 Mon Sep 17 00:00:00 2001 From: igoogolx <27353191+igoogolx@users.noreply.github.com> Date: Sun, 16 Jun 2024 07:25:30 +0800 Subject: [PATCH] refactor: remove unused code --- internal/cfg/distribution/ruleEngine/builtIn.go | 2 +- internal/cfg/distribution/ruleEngine/domain.go | 2 +- internal/cfg/distribution/ruleEngine/ipcidr.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/cfg/distribution/ruleEngine/builtIn.go b/internal/cfg/distribution/ruleEngine/builtIn.go index c531578..b7908be 100644 --- a/internal/cfg/distribution/ruleEngine/builtIn.go +++ b/internal/cfg/distribution/ruleEngine/builtIn.go @@ -13,7 +13,7 @@ type builtIn struct { } func (p builtIn) GetPolicy() constants.Policy { - return constants.Policy(p.Policy) + return p.Policy } func (p builtIn) Type() constants.RuleType { diff --git a/internal/cfg/distribution/ruleEngine/domain.go b/internal/cfg/distribution/ruleEngine/domain.go index 9b44c1d..4cc71cf 100644 --- a/internal/cfg/distribution/ruleEngine/domain.go +++ b/internal/cfg/distribution/ruleEngine/domain.go @@ -17,7 +17,7 @@ func (d Domain) GetPolicy() constants.Policy { } func (d Domain) Type() constants.RuleType { - return constants.RuleDomain + return d.RuleType } func (d Domain) Match(value string) bool { diff --git a/internal/cfg/distribution/ruleEngine/ipcidr.go b/internal/cfg/distribution/ruleEngine/ipcidr.go index cb7bdea..d6efe63 100644 --- a/internal/cfg/distribution/ruleEngine/ipcidr.go +++ b/internal/cfg/distribution/ruleEngine/ipcidr.go @@ -12,8 +12,8 @@ type IpCidr struct { Policy constants.Policy `json:"policy"` } -func (d IpCidr) GetPolicy() constants.Policy { - return constants.Policy(d.Policy) +func (i IpCidr) GetPolicy() constants.Policy { + return i.Policy } func (i IpCidr) Type() constants.RuleType {