Skip to content

Commit dac5ddd

Browse files
SimplyLizclaude
andcommitted
fix(lint): errcheck in client_test.go, gofmt in server.go
- client_test.go: assign _ = for conn.SetDeadline, _, _ = for io.ReadFull, conn.Write in TestResponseSizeGuard; add _, _ = / _, _, _ = for wire-protocol tests that only assert the request shape and don't consume the returned (result, error) - server.go: fix gofmt alignment in http.Server literal (Addr/Handler fields were over-aligned after WriteTimeout was added in the previous commit) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9b64211 commit dac5ddd

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

internal/api/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ func NewServer(addr string, engine *query.Engine, logger *slog.Logger, config Se
9191
// Create HTTP server with configured router and middleware
9292
handler := s.applyMiddleware(s.router)
9393
s.server = &http.Server{
94-
Addr: addr,
95-
Handler: handler,
94+
Addr: addr,
95+
Handler: handler,
9696
ReadTimeout: 15 * time.Second,
9797
// WriteTimeout must accommodate long-running endpoints like /review/pr
9898
// and /architecture/refresh which can take several minutes on large repos.

internal/lip/client_test.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func (d *testDaemon) serve() {
7777
return // listener closed by cleanup
7878
}
7979
defer conn.Close()
80-
conn.SetDeadline(time.Now().Add(2 * time.Second))
80+
_ = conn.SetDeadline(time.Now().Add(2 * time.Second))
8181

8282
// Read length-prefixed request.
8383
var lenBuf [4]byte
@@ -346,7 +346,7 @@ func TestWireProtocol_NearestByTextFiltered_Omitempty(t *testing.T) {
346346
// filter, min_score, model are all zero — must NOT appear in the request.
347347
d := newTestDaemon(t, nearestResp{})
348348

349-
NearestByTextFiltered("query", 5, "", 0, "")
349+
_, _ = NearestByTextFiltered("query", 5, "", 0, "")
350350
d.waitHandled(t)
351351

352352
req := d.req()
@@ -378,7 +378,7 @@ func TestWireProtocol_NearestByFileFiltered(t *testing.T) {
378378
func TestWireProtocol_NearestByFile_Delegates(t *testing.T) {
379379
d := newTestDaemon(t, nearestResp{})
380380

381-
NearestByFile("file://x.go", 3)
381+
_, _ = NearestByFile("file://x.go", 3)
382382
d.waitHandled(t)
383383

384384
req := d.req()
@@ -563,7 +563,7 @@ func TestWireProtocol_FindBoundaries(t *testing.T) {
563563
func TestWireProtocol_FindBoundaries_Omitempty(t *testing.T) {
564564
d := newTestDaemon(t, boundariesResp{})
565565

566-
FindBoundaries("file://x.go", 0, 0, "")
566+
_, _ = FindBoundaries("file://x.go", 0, 0, "")
567567
d.waitHandled(t)
568568

569569
req := d.req()
@@ -716,7 +716,7 @@ func TestWireProtocol_Handshake(t *testing.T) {
716716
func TestWireProtocol_Handshake_NoVersion(t *testing.T) {
717717
d := newTestDaemon(t, handshakeResp{})
718718

719-
Handshake("")
719+
_, _ = Handshake("")
720720
d.waitHandled(t)
721721

722722
req := d.req()
@@ -752,7 +752,7 @@ func TestWireProtocol_ExplainMatch(t *testing.T) {
752752
func TestWireProtocol_ExplainMatch_Omitempty(t *testing.T) {
753753
d := newTestDaemon(t, explainMatchResp{})
754754

755-
ExplainMatch("q", "file://x.go", 0, 0, "")
755+
_, _, _ = ExplainMatch("q", "file://x.go", 0, 0, "")
756756
d.waitHandled(t)
757757

758758
req := d.req()
@@ -844,7 +844,7 @@ func TestWireProtocol_SemanticDiff(t *testing.T) {
844844
func TestWireProtocol_SemanticDiff_Omitempty(t *testing.T) {
845845
d := newTestDaemon(t, semanticDiffResp{})
846846

847-
SemanticDiff("a", "b", 0, "")
847+
_, _ = SemanticDiff("a", "b", 0, "")
848848
d.waitHandled(t)
849849

850850
req := d.req()
@@ -910,19 +910,19 @@ func TestResponseSizeGuard(t *testing.T) {
910910
return
911911
}
912912
defer conn.Close()
913-
conn.SetDeadline(time.Now().Add(2 * time.Second))
913+
_ = conn.SetDeadline(time.Now().Add(2 * time.Second))
914914

915915
// Drain the request.
916916
var lenBuf [4]byte
917-
io.ReadFull(conn, lenBuf[:])
917+
_, _ = io.ReadFull(conn, lenBuf[:])
918918
reqLen := binary.BigEndian.Uint32(lenBuf[:])
919-
io.ReadFull(conn, make([]byte, reqLen))
919+
_, _ = io.ReadFull(conn, make([]byte, reqLen))
920920

921921
// Send a response that claims to be 8192 bytes — over the 4096 limit.
922922
oversized := uint32(8192)
923923
var respLen [4]byte
924924
binary.BigEndian.PutUint32(respLen[:], oversized)
925-
conn.Write(respLen[:])
925+
_, _ = conn.Write(respLen[:])
926926
// Don't send the body — client should bail after reading the length.
927927
}()
928928

0 commit comments

Comments
 (0)