From 17c53d8b383310ef583874d1bfee79b73231729b Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Wed, 16 Nov 2022 14:27:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E5=8F=98=E9=87=8F=E5=88=86?= =?UTF-8?q?=E6=9E=90=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/configutils/variable_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/configutils/variable_test.go b/pkg/configutils/variable_test.go index aff81f7..03932f1 100644 --- a/pkg/configutils/variable_test.go +++ b/pkg/configutils/variable_test.go @@ -55,11 +55,13 @@ func BenchmarkParseVariables(b *testing.B) { b.ResetTimer() - for i := 0; i < b.N; i++ { - _ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string { - return "Lu" - }) - } + b.RunParallel(func(pb *testing.PB) { + for pb.Next() { + _ = ParseVariables("hello, ${name}, ${age}, ${gender}, ${home}, world", func(s string) string { + return "Lu" + }) + } + }) } func BenchmarkParseVariablesFromHolders(b *testing.B) {