From 51a0e1a4bbcd0b7ee4d41537a3dee63db8191187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= Date: Fri, 31 Jul 2020 23:58:32 +0200 Subject: [PATCH] Convert int to string using fmt.Sprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/golang/go/issues/32479 Fix #341. Signed-off-by: Robert-André Mauchin --- bench_iteration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bench_iteration_test.go b/bench_iteration_test.go index 39445b0..fe21b3d 100644 --- a/bench_iteration_test.go +++ b/bench_iteration_test.go @@ -1,6 +1,7 @@ package goquery import ( + "fmt" "testing" ) @@ -31,7 +32,7 @@ func BenchmarkMap(b *testing.B) { sel := DocW().Find("td") f := func(i int, s *Selection) string { tmp++ - return string(tmp) + return fmt.Sprintf("%d", tmp) } b.StartTimer() for i := 0; i < b.N; i++ {