Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrency chapter - example of goroutine loop variables is no longer applicable as of go version 1.22 #740

Closed
rqpt opened this issue Feb 24, 2024 · 3 comments

Comments

@rqpt
Copy link

rqpt commented Feb 24, 2024

tldr - This behaviour is something that has been addressed in the latest go release.

I am currently reading this book (excellent btw), and am coding along until I get to the '...and we're back' section of the concurrency chapter.

tdd-go-concurrency-chapter

I ran this example and my tests pass just fine.

tdd-go-concurrency-editor

I then set out to investigate why, as this should fail according to the chapter, and this video cleared things up for me -
https://www.youtube.com/watch?v=Smc-6qfZ2JU

@quii
Copy link
Owner

quii commented Feb 29, 2024

Good spot! Do you fancy making a PR?

@rqpt
Copy link
Author

rqpt commented Feb 29, 2024

I'll give it a shot, sure! I'll try and tackle it this weekend.

primeapple added a commit to primeapple/learn-go-with-tests-bok that referenced this issue Nov 22, 2024
@primeapple
Copy link
Contributor

I took some minutes and added a PR for this.

@quii quii closed this as completed in 604fe62 Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants