Browse Source

cmd: use net.ErrClosed for matching returned error (#4289)

Implements #3805
master
M. Ángel Jimeno 3 years ago
committed by GitHub
parent
commit
9e333c39da
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      cmd/commandfuncs.go

3
cmd/commandfuncs.go

@ -19,6 +19,7 @@ import (
"context"
"crypto/rand"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
@ -119,7 +120,7 @@ func cmdStart(fl Flags) (int, error) {
for {
conn, err := ln.Accept()
if err != nil {
if !strings.Contains(err.Error(), "use of closed network connection") {
if !errors.Is(err, net.ErrClosed) {
log.Println(err)
}
break

Loading…
Cancel
Save