mcp: address some comments from #234 (#248)

I inadvertently merged #234 without pushing my latest patches. This CL
adds the missing changes.
This commit is contained in:
Robert Findley 2025-08-11 12:45:14 -04:00 • committed by GitHub
commit 119a58314d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -318,9 +318,9 @@ func newIOConn(rwc io.ReadWriteCloser) *ioConn {
// Start a goroutine for reads, so that we can select on the incoming channel
// in [ioConn.Read] and unblock the read as soon as Close is called (see #224).
//
// This leaks a goroutine, but that is unavoidable since AFAIK there is no
// (easy and portable) way to guarantee that reads of stdin are unblocked
// when closed.
// This leaks a goroutine if rwc.Read does not unblock after it is closed,
// but that is unavoidable since AFAIK there is no (easy and portable) way to
// guarantee that reads of stdin are unblocked when closed.
go func() {
dec := json.NewDecoder(rwc)
for {