From 083c1550792b6828ae043d89f1d4fb98a73e5965 Mon Sep 17 00:00:00 2001 From: nkbai Date: Sat, 19 Dec 2015 10:29:12 +0800 Subject: [PATCH] cors test benchmark doesn't use b.N --- plugins/cors/cors_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/cors/cors_test.go b/plugins/cors/cors_test.go index ee5ee238..84d21cd0 100644 --- a/plugins/cors/cors_test.go +++ b/plugins/cors/cors_test.go @@ -225,8 +225,8 @@ func Benchmark_WithoutCORS(b *testing.B) { ctx.Output.SetStatus(500) }) b.ResetTimer() - for i := 0; i < 100; i++ { - r, _ := http.NewRequest("PUT", "/foo", nil) + r, _ := http.NewRequest("PUT", "/foo", nil) + for i := 0; i < b.N; i++ { handler.ServeHTTP(recorder, r) } } @@ -246,8 +246,8 @@ func Benchmark_WithCORS(b *testing.B) { ctx.Output.SetStatus(500) }) b.ResetTimer() - for i := 0; i < 100; i++ { - r, _ := http.NewRequest("PUT", "/foo", nil) + r, _ := http.NewRequest("PUT", "/foo", nil) + for i := 0; i < b.N; i++ { handler.ServeHTTP(recorder, r) } }