Skip to content

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.

3 participants