From ce3515391bc6b4fd4cc796f743d6744c412484da Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Wed, 29 Jul 2015 08:42:23 +0200 Subject: [PATCH] bind: fix shared buffer bug --- bind/bind.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bind/bind.go b/bind/bind.go index 0d56827..1e172fc 100644 --- a/bind/bind.go +++ b/bind/bind.go @@ -28,10 +28,9 @@ func (list ErrorList) Error() string { // GenCPython generates a (C)Python package from a Go package func GenCPython(w io.Writer, fset *token.FileSet, pkg *Package) error { - buf := new(bytes.Buffer) gen := &cpyGen{ - decl: &printer{buf: buf, indentEach: []byte("\t")}, - impl: &printer{buf: buf, indentEach: []byte("\t")}, + decl: &printer{buf: new(bytes.Buffer), indentEach: []byte("\t")}, + impl: &printer{buf: new(bytes.Buffer), indentEach: []byte("\t")}, fset: fset, pkg: pkg, }