Skip to content

Conversation

@snk-git-hub
Copy link
Contributor

Replace b.Loop() with for i:= 0; i< b.N; i++ syntax in

  • blogrenderer/renderer_test.go
  • concurrency/v1/check_websites_benchmark_test.go
  • concurrency/v2/check_websites_benchmark_test.go
  • concurrency/v3/check_websites_benchmark_test.go
  • for/vx/repeat_test.go
  • concurrency.md
  • html-templates.md (2 instances)
  • iteration.md (2 instances)

Verified with ./build.sh - all tests pass

Fixes #869

@quii
Copy link
Owner

quii commented Aug 13, 2025

Love it, thanks

@quii quii merged commit 0a483a5 into quii:main Aug 13, 2025
1 check passed
@nicholasbraun
Copy link
Contributor

Why is i := 0; i < b.N: i++ the correct syntax? The go blog says the b.Loop() syntax is the preferred way to do it.

@quii
Copy link
Owner

quii commented Aug 13, 2025

Oh yeah, i totally misread the PR in my lack of coffee haze. Think i'll revert!

quii added a commit that referenced this pull request Aug 13, 2025
@quii
Copy link
Owner

quii commented Aug 13, 2025

I legit read it as going from the old syntax to the new one :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Go doesn't have a Loop() method under *testing.B

3 participants