-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
lsp: Return copies of cache maps #760
Conversation
internal/lsp/cache/cache.go
Outdated
@@ -84,7 +84,12 @@ func (c *Cache) GetAllFiles() map[string]string { | |||
c.fileContentsMu.Lock() | |||
defer c.fileContentsMu.Unlock() | |||
|
|||
return c.fileContents | |||
cp := make(map[string]string, len(c.fileContents)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we could use maps.Clone
for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh go is cool now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added this in 14290c4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but @srenatus suggestion sounds good
3724aa4
to
5175807
Compare
Addressing: StyraInc#750 Signed-off-by: Charlie Egan <charlie@styra.com>
5175807
to
14290c4
Compare
Addressing: StyraInc#750 Signed-off-by: Charlie Egan <charlie@styra.com>
Fixes: #750