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:
parent
a00916dd39
commit
063514c48b
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user