tools/internal/lsp/cache
Edward Muller 26e35f15ed internal/lsp/cache: fix leaking wg.Done() and <-ioLimit
There were several returns in this function that could leak both the
wg.Done() and <-ioLimit. This refactors them into defers close to their
counterparts.

Additionally I refactored the function to favor early returns over
nested if statements.

Fixes golang/go#32368

Change-Id: I5357d11ee526c1cb7a6bd1a0f652c61d574c10ab
GitHub-Last-Rev: bfa160b9fd75c4464d2e0a2820c04ddae01de21f
GitHub-Pull-Request: golang/tools#107
Reviewed-on: https://go-review.googlesource.com/c/tools/+/179878
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Run-TryBot: Ian Cottrell <iancottrell@google.com>
2019-05-31 22:35:38 +00:00
..
cache.go internal/lsp: add file watching and use it to trigger invalidations 2019-05-24 14:03:12 +00:00
check.go internal/lsp: refactor to separate pieces of type-checking 2019-05-30 04:37:10 +00:00
external.go internal/lsp: add a file system abstraction 2019-05-24 13:48:47 +00:00
file.go internal/lsp: refactor to separate pieces of type-checking 2019-05-30 04:37:10 +00:00
gofile.go internal/lsp: refactor to separate pieces of type-checking 2019-05-30 04:37:10 +00:00
load.go internal/lsp: refactor to separate pieces of type-checking 2019-05-30 04:37:10 +00:00
modfile.go internal/lsp: add modfile, sumfile structs, require Go files for diagnostics 2019-05-24 21:02:28 +00:00
parse.go internal/lsp/cache: fix leaking wg.Done() and <-ioLimit 2019-05-31 22:35:38 +00:00
pkg.go internal/lsp: refactor to separate pieces of type-checking 2019-05-30 04:37:10 +00:00
session.go internal/lsp: fix setting overlays in tests 2019-05-29 19:11:38 +00:00
sumfile.go internal/lsp: add modfile, sumfile structs, require Go files for diagnostics 2019-05-24 21:02:28 +00:00
view.go internal/lsp: add modfile, sumfile structs, require Go files for diagnostics 2019-05-24 21:02:28 +00:00
watcher.go internal/lsp: add file watching and use it to trigger invalidations 2019-05-24 14:03:12 +00:00