aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/memory.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-05-04 01:45:11 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-05-04 01:45:11 +0200
commitff18ce3751ad80cfd0297845872ba1d796c36ca5 (patch)
tree0b0a72f26482bc61bad7258d10a9a2d1392d2b90 /plumbing/memory.go
parent5592dabdf9eed67c92b0e411ad375ae763119fd2 (diff)
downloadgo-git-ff18ce3751ad80cfd0297845872ba1d796c36ca5.tar.gz
plumbing: MemoryObject.Writer tracks his own size
Diffstat (limited to 'plumbing/memory.go')
-rw-r--r--plumbing/memory.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/plumbing/memory.go b/plumbing/memory.go
index c65ce1f..51cbb54 100644
--- a/plumbing/memory.go
+++ b/plumbing/memory.go
@@ -51,6 +51,8 @@ func (o *MemoryObject) Writer() (io.WriteCloser, error) {
func (o *MemoryObject) Write(p []byte) (n int, err error) {
o.cont = append(o.cont, p...)
+ o.sz = int64(len(o.cont))
+
return len(p), nil
}