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

add SyncLockMap ctor func #227

Merged
merged 3 commits into from
Jul 31, 2023
Merged

add SyncLockMap ctor func #227

merged 3 commits into from
Jul 31, 2023

Conversation

dogancanbakir
Copy link
Member

Proposed changes

SyncLockMap turned out to be very useful as LOC reduction strategy since it can replace any builtin map that requires a mutex. Actually the structure must be initialized with some long boilerplate code as follows:

m := &SyncLockMap[string, string]{
	Map: make(map[string, string]),
}

The task is about implementing a NewSyncLockMap[K,V](...) function that returns new SyncLockMap with the underlying Map initialized. Closes #226.

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

lgtm!

@Mzack9999 Mzack9999 merged commit 008b0e9 into main Jul 31, 2023
7 checks passed
@Mzack9999 Mzack9999 deleted the add_synclockmap_ctor_func branch July 31, 2023 15:56
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.

Add NewSyncLockMap[K,V](...) helper
2 participants