Add golangci-lint gate and fix its findings

Configure golangci-lint v2 for the whole tree (brlapi/duckdb build tags, curated linters, documented exclusions) and resolve what it reports: dead code, wrapped-error comparisons and %w wrapping, unclosed websocket handshake bodies, staticcheck SA/S items, ineffectual assignments, and explicit _ = discards for best-effort teardown errors. Document the gate in CONTRIBUTING and AGENTS.
This commit is contained in:
hjozwiak committed 2026-11-10 21:13:49 -05:00
1 parent b03cb8917d
commit 0459fb8e50
43 files changed
+166 -112

No files matched your search

+4 -2
View File
@@ -74,10 +74,11 @@ func liveSocketTest(t *testing.T) {
httpTest := httptest.NewServer(http.HandlerFunc(server.handleHTTP))
defer httpTest.Close()
url := "ws" + strings.TrimPrefix(httpTest.URL, "http")
connection, _, err := websocket.DefaultDialer.Dial(url, nil)
connection, response, err := websocket.DefaultDialer.Dial(url, nil)
if err != nil {
t.Fatalf("dial WebSocket: %v", err)
}
defer response.Body.Close()
defer connection.Close()
if err := connection.WriteMessage(websocket.TextMessage, []byte("Accessibility mod loaded.")); err != nil {
@@ -129,10 +130,11 @@ func TestStartStopClosesActiveConnection(t *testing.T) {
if err := server.Start(context.Background()); err != nil {
t.Fatalf("start server: %v", err)
}
connection, _, err := websocket.DefaultDialer.Dial(fmt.Sprintf("ws://127.0.0.1:%d", port), nil)
connection, response, err := websocket.DefaultDialer.Dial(fmt.Sprintf("ws://127.0.0.1:%d", port), nil)
if err != nil {
t.Fatalf("dial server: %v", err)
}
defer response.Body.Close()
defer connection.Close()
if err := server.Stop(context.Background()); err != nil {
t.Fatalf("stop server: %v", err)