TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A study of real world data races in Golang

1 pointsby pramodbiligiriabout 3 years ago

1 comment

Ajnaszabout 3 years ago
&gt; 4.2.2 Idiomatic err variable capture.<p>I&#x27;m trying to reproduce that in this play: <a href="https:&#x2F;&#x2F;go.dev&#x2F;play&#x2F;p&#x2F;3wkkfN3bMfH" rel="nofollow">https:&#x2F;&#x2F;go.dev&#x2F;play&#x2F;p&#x2F;3wkkfN3bMfH</a><p>Based on the study, I expect that the final print would print `err final value err:bar, 2`, but it&#x27;s `&lt;nil&gt;`. And it is because it uses the shorthand variable declaration, which will make it to be in the scope of the go function closure.<p>Am I missing something?