diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-12-12 15:50:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-12 15:50:15 +0100 |
commit | df9748cfb51db9c406e3df063badbd8c78ee819d (patch) | |
tree | c03578daefa14b14ca480c3e801ee8e225599b22 /utils/ioutil | |
parent | 3967812bd0de40330dfbb9e1a7d14d4073cc1b10 (diff) | |
download | go-git-df9748cfb51db9c406e3df063badbd8c78ee819d.tar.gz |
transport: new git protocol (#175)
Diffstat (limited to 'utils/ioutil')
-rw-r--r-- | utils/ioutil/common.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/ioutil/common.go b/utils/ioutil/common.go index 13db692..f5b78df 100644 --- a/utils/ioutil/common.go +++ b/utils/ioutil/common.go @@ -50,3 +50,15 @@ func (r *readCloser) Close() error { func NewReadCloser(r io.Reader, c io.Closer) io.ReadCloser { return &readCloser{Reader: r, closer: c} } + +type writeNopCloser struct { + io.Writer +} + +func (writeNopCloser) Close() error { return nil } + +// WriteNopCloser returns a WriteCloser with a no-op Close method wrapping +// the provided Writer w. +func WriteNopCloser(w io.Writer) io.WriteCloser { + return writeNopCloser{w} +} |