From ea659265d269f677c46b311da2c0b153322781f2 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 17 Dec 2018 16:39:43 +0100 Subject: Remove unused vendored code --- .../gitlab-org/gitaly-proto/go/helper/inforefs.go | 32 ---------------- .../gitlab-org/gitaly-proto/go/helper/stream.go | 44 ---------------------- go/vendor/vendor.json | 8 ---- 3 files changed, 84 deletions(-) delete mode 100644 go/vendor/gitlab.com/gitlab-org/gitaly-proto/go/helper/inforefs.go delete mode 100644 go/vendor/gitlab.com/gitlab-org/gitaly-proto/go/helper/stream.go diff --git a/go/vendor/gitlab.com/gitlab-org/gitaly-proto/go/helper/inforefs.go b/go/vendor/gitlab.com/gitlab-org/gitaly-proto/go/helper/inforefs.go deleted file mode 100644 index 5ddfbc2..0000000 --- a/go/vendor/gitlab.com/gitlab-org/gitaly-proto/go/helper/inforefs.go +++ /dev/null @@ -1,32 +0,0 @@ -package helper - -import ( - "io" - - pb "gitlab.com/gitlab-org/gitaly-proto/go" -) - -type InfoRefsClient interface { - Recv() (*pb.InfoRefsResponse, error) -} - -type InfoRefsClientWriterTo struct { - InfoRefsClient -} - -func (clientReader *InfoRefsClientWriterTo) WriteTo(w io.Writer) (total int64, err error) { - for { - response, err := clientReader.Recv() - if err == io.EOF { - return total, nil - } else if err != nil { - return total, err - } - - n, err := w.Write(response.GetData()) - total += int64(n) - if err != nil { - return total, err - } - } -} diff --git a/go/vendor/gitlab.com/gitlab-org/gitaly-proto/go/helper/stream.go b/go/vendor/gitlab.com/gitlab-org/gitaly-proto/go/helper/stream.go deleted file mode 100644 index 77cd157..0000000 --- a/go/vendor/gitlab.com/gitlab-org/gitaly-proto/go/helper/stream.go +++ /dev/null @@ -1,44 +0,0 @@ -package helper - -import ( - "io" -) - -// NewReceiveReader turns receiver into an io.Reader. Errors from the -// receiver function are passed on unmodified. This means receiver should -// emit io.EOF when done. -func NewReceiveReader(receiver func() ([]byte, error)) io.Reader { - return &receiveReader{receiver: receiver} -} - -type receiveReader struct { - receiver func() ([]byte, error) - data []byte - err error -} - -func (rr *receiveReader) Read(p []byte) (int, error) { - if len(rr.data) == 0 { - rr.data, rr.err = rr.receiver() - } - n := copy(p, rr.data) - rr.data = rr.data[n:] - if len(rr.data) == 0 { - return n, rr.err - } - return n, nil -} - -// NewSendWriter turns sender into an io.Writer. The number of 'bytes -// written' reported back is always len(p). -func NewSendWriter(sender func(p []byte) error) io.Writer { - return &sendWriter{sender: sender} -} - -type sendWriter struct { - sender func([]byte) error -} - -func (sw *sendWriter) Write(p []byte) (int, error) { - return len(p), sw.sender(p) -} diff --git a/go/vendor/vendor.json b/go/vendor/vendor.json index 2c7b3bc..d4f9288 100644 --- a/go/vendor/vendor.json +++ b/go/vendor/vendor.json @@ -76,14 +76,6 @@ "version": "v1.3.0", "versionExact": "v1.3.0" }, - { - "checksumSHA1": "GkeSZfXVbtAkBZOrswot19GJZqQ=", - "path": "gitlab.com/gitlab-org/gitaly-proto/go/helper", - "revision": "ca09ca1e2da6dc957644fa95990e8a3d032d6252", - "revisionTime": "2018-11-28T10:00:28Z", - "version": "v1.3.0", - "versionExact": "v1.3.0" - }, { "checksumSHA1": "oUtVvP0F/NLt9fen+qUoOnfQHv0=", "path": "gitlab.com/gitlab-org/gitaly/auth", -- cgit v1.2.1