Skip to content

[bugfix] Fix for data race in PascalCase#942

Open
dragneelfps wants to merge 1 commit intouber:masterfrom
dragneelfps:bugfix-data-race-casing
Open

[bugfix] Fix for data race in PascalCase#942
dragneelfps wants to merge 1 commit intouber:masterfrom
dragneelfps:bugfix-data-race-casing

Conversation

@dragneelfps
Copy link
Copy Markdown

when using PascalCase in parallel constructs, the existing code can lead to data races.
Using once.Do will ensure the initialization happens only once.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Jun 26, 2025

CLA assistant check
All committers have signed the CLA.


var pascalCaseMap *sync.Map
var (
pascalCaseMap *sync.Map
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use pascalCaseMap sync.Map, which will create a sync.Map and we don't need sync.Once and no need to check for nil.

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.

3 participants