Skip to content

Commit 79fd8e8

Browse files
committed
serve: fix lint suggestions
1 parent d4bc10f commit 79fd8e8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

serve_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-FileCopyrightText: Copyright 2021 The Go Language Server Authors
22
// SPDX-License-Identifier: BSD-3-Clause
33

4-
package jsonrpc2
4+
package jsonrpc2_test
55

66
import (
77
"context"
@@ -10,6 +10,8 @@ import (
1010
"sync"
1111
"testing"
1212
"time"
13+
14+
"go.lsp.dev/jsonrpc2"
1315
)
1416

1517
func TestIdleTimeout(t *testing.T) {
@@ -30,16 +32,15 @@ func TestIdleTimeout(t *testing.T) {
3032
return conn
3133
}
3234

33-
server := HandlerServer(MethodNotFoundHandler)
34-
// connTimer := &fakeTimer{c: make(chan time.Time, 1)}
35+
server := jsonrpc2.HandlerServer(jsonrpc2.MethodNotFoundHandler)
3536
var (
3637
runErr error
3738
wg sync.WaitGroup
3839
)
3940
wg.Add(1)
4041
go func() {
4142
defer wg.Done()
42-
runErr = Serve(ctx, ln, server, 100*time.Millisecond)
43+
runErr = jsonrpc2.Serve(ctx, ln, server, 100*time.Millisecond)
4344
}()
4445

4546
// Exercise some connection/disconnection patterns, and then assert that when
@@ -53,7 +54,7 @@ func TestIdleTimeout(t *testing.T) {
5354

5455
wg.Wait()
5556

56-
if !errors.Is(runErr, ErrIdleTimeout) {
57-
t.Errorf("run() returned error %v, want %v", runErr, ErrIdleTimeout)
57+
if !errors.Is(runErr, jsonrpc2.ErrIdleTimeout) {
58+
t.Errorf("run() returned error %v, want %v", runErr, jsonrpc2.ErrIdleTimeout)
5859
}
5960
}

0 commit comments

Comments
 (0)