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

Iter5 #5

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Iter5 #5

wants to merge 16 commits into from

Conversation

shilin-anton
Copy link
Owner

Add ENV params

type Storage map[string]string

func (s Storage) Add(short string, url string) {
s[short] = url

Choose a reason for hiding this comment

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

Мапа при конкурентном доступе к ней выдает панику, учти это на будущее

Copy link
Owner Author

Choose a reason for hiding this comment

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

можно ли решить эту проблему, переделав Storage в структуру, в которой будет мапа и мьютекс?
и перед каждым обращением делать лок, с последующим анлоком?

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.

2 participants