service/dap: use == to test io.EOF (#3464)

The documentation of io.EOF: Read must return EOF itself, not an error
wrapping EOF, because callers will test for EOF using ==.

This is a trivial change; people may think it's normal use of "errors.Is",
even it's OK, it could be replaced with "errors.Is(err, io.EOF)" in idiomatic way.
This commit is contained in:
gocurr 2023-08-12 15:41:30 +08:00 committed by GitHub
parent 891a1f080d
commit 17d1f4c829
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1051,7 +1051,7 @@ func (s *Session) onLaunchRequest(request *dap.LaunchRequest) {
for { for {
n, err := reader.Read(out[:]) n, err := reader.Read(out[:])
if err != nil { if err != nil {
if errors.Is(io.EOF, err) { if err == io.EOF {
return return
} }
s.config.log.Errorf("failed read by %s - %v ", category, err) s.config.log.Errorf("failed read by %s - %v ", category, err)