1
0
mirror of https://github.com/golang/go synced 2024-11-18 16:04:44 -07:00

internal/lsp/cmd: replace time.Tick with time.After

time.Tick produces multiple ticks (and leaks a Ticker); time.After
produces a single tick, which is what is called for here.

Change-Id: I922b11e1263a8367afec76c10831b7284f3559ec
Reviewed-on: https://go-review.googlesource.com/c/tools/+/184938
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Jonathan Amsterdam 2019-07-03 13:06:27 -04:00
parent a00916dd39
commit 063514c48b

View File

@ -59,7 +59,7 @@ func (c *check) Run(ctx context.Context, args ...string) error {
for _, file := range checking {
select {
case <-file.hasDiagnostics:
case <-time.Tick(30 * time.Second):
case <-time.After(30 * time.Second):
return fmt.Errorf("timed out waiting for results from %v", file.uri)
}
file.diagnosticsMu.Lock()