From 3e3eda06723bdb43aa9d2a4939c5681ad1289567 Mon Sep 17 00:00:00 2001 From: David Cuadrado Date: Thu, 25 Mar 2021 12:58:24 -0500 Subject: [PATCH] Compatibility for go 1.13 Because it's required by the pipeline --- plumbing/transport/ssh/common.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plumbing/transport/ssh/common.go b/plumbing/transport/ssh/common.go index b0dbbaa6e..46e79134c 100644 --- a/plumbing/transport/ssh/common.go +++ b/plumbing/transport/ssh/common.go @@ -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" @@ -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 }