Skip to content

Commit

Permalink
Compatibility for go 1.13
Browse files Browse the repository at this point in the history
Because it's required by the pipeline
  • Loading branch information
dcu committed Mar 25, 2021
1 parent 2b4fdd7 commit 3e3eda0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plumbing/transport/ssh/common.go
Expand Up @@ -3,11 +3,10 @@ package ssh

import (
"context"
"errors"
"fmt"
"net"
"reflect"
"strconv"
"strings"

"github.com/go-git/go-git/v5/plumbing/transport"
"github.com/go-git/go-git/v5/plumbing/transport/internal/common"
Expand Down Expand Up @@ -94,7 +93,8 @@ func (c *command) Close() error {
_ = c.Session.Close()
err := c.client.Close()

if errors.Is(err, net.ErrClosed) {
//XXX: in go1.16+ we can use errors.Is(err, net.ErrClosed)
if err != nil && strings.HasSuffix(err.Error(), "use of closed network connection") {
return nil
}

Expand Down

0 comments on commit 3e3eda0

Please sign in to comment.