Skip to content

Commit dc00876

Browse files
Copilotpjbgf
andauthored
fix: address code review - simplify ignored error in backendHandler.ServeTCP
Agent-Logs-Url: https://github.com/go-git/cli/sessions/59e4b568-dc12-43b2-88e0-3025f7b6fa16 Co-authored-by: pjbgf <5452977+pjbgf@users.noreply.github.com>
1 parent 34ad6c1 commit dc00876

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

server/git/server.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ type backendHandler struct {
4242
func (bh *backendHandler) ServeTCP(ctx context.Context, c io.ReadWriteCloser, req *packp.GitProtoRequest) {
4343
backendReq := backend.RequestFromProto(req)
4444
if err := bh.b.Serve(ctx, c, c, backendReq); err != nil {
45-
if rErr := renderError(c, fmt.Errorf("error serving request: %w", err)); rErr != nil {
46-
_ = rErr
47-
}
45+
// Best-effort error notification; ignore if the write itself fails.
46+
_ = renderError(c, fmt.Errorf("error serving request: %w", err))
4847
}
4948
}
5049

0 commit comments

Comments
 (0)