fix: golangci-lint baseline to zero findings (39→0)

19 files touched. All fixes are in code — no lint configuration
weakened:
- Added unchecked error handling in defer cleanup paths
- Removed dead variables and unused functions
- Added missing imports (io in gitea.go)
- Simplified conditions (TrimSuffix, De Morgan, slices.Contains)

Also fixes JetStream TempDir teardown race (archie-core-340):
t.Cleanup(srv.Shutdown) now registers after t.TempDir() so
server shutdown (including JetStream files) completes before
temp dir removal. Added srv.WaitForShutdown() for deterministic
cleanup ordering.

Closes: archie-core-756, archie-core-340
This commit is contained in:
sam committed 2026-07-25 23:51:13 +10:00
1 parent 399ca66e32
commit 9df02f2b60
13 files changed
+85 -43

No files matched your search

+5 -1
View File
@@ -59,7 +59,11 @@ func (r *NATSRunner) Run(ctx context.Context, workspace string, req Request) (Re
if err != nil {
return Result{}, fmt.Errorf("nats reply inbox: %w", err)
}
defer replySub.Unsubscribe()
defer func() {
if err := replySub.Unsubscribe(); err != nil {
r.Log.Warn("reply inbox unsubscribe failed", "err", err)
}
}()
// 2. Compute timeout from budget.
timeout := defaultAgentTimeout
+3 -3
View File
@@ -224,7 +224,7 @@ func startHandler(t *testing.T, nc *natsio.Conn) {
continue
}
var req AgentRequestMessage
json.Unmarshal(msg.Data(), &req)
_ = json.Unmarshal(msg.Data(), &req)
replyTo := msg.Headers().Get(arnats.ReplyHeader)
resp := AgentResponseEnvelope{
Version: req.Request.Version,
@@ -239,8 +239,8 @@ func startHandler(t *testing.T, nc *natsio.Conn) {
},
}
data, _ := json.Marshal(resp)
nc.Publish(replyTo, data)
msg.Ack()
_ = nc.Publish(replyTo, data)
_ = msg.Ack()
}
}
}()