From 6a4d2b336819e89e9bf10b0dfb767c7460675fc5 Mon Sep 17 00:00:00 2001 From: admin <2833154405@qq.com> Date: Mon, 21 Mar 2022 12:34:32 +0800 Subject: [PATCH] Change type conversion method --- rule/provider/provider.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rule/provider/provider.go b/rule/provider/provider.go index a587ecaf..9ffc788f 100644 --- a/rule/provider/provider.go +++ b/rule/provider/provider.go @@ -11,7 +11,6 @@ import ( "runtime" "strings" "time" - "unsafe" ) var ( @@ -132,7 +131,7 @@ func NewRuleSetProvider(name string, behavior P.RuleType, interval time.Duration } if rp.behavior == P.Classical { - rp.count = len(*(*[]C.Rule)(unsafe.Pointer(&rules))) + rp.count = len(rules.([]C.Rule)) } else { rp.count = len(rulesRaw) }