From af804a47fad2e80cb745a9b23f6bf6390ea31b3a Mon Sep 17 00:00:00 2001 From: Yves Junqueira Date: Wed, 21 Jul 2010 11:28:50 +0100 Subject: [PATCH] Fix build problem with recent go release: vector Data() was renamed to Copy(). Also changed our own decoder method to reflect this. --- decode.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/decode.go b/decode.go index a0757a3..12b6133 100644 --- a/decode.go +++ b/decode.go @@ -27,7 +27,7 @@ func Decode(r io.Reader) (data interface{}, err os.Error) { jb := newDecoder(nil, nil) err = Parse(r, jb) if err == nil { - data = jb.Data() + data = jb.Copy() } return } @@ -87,18 +87,18 @@ func (j *decoder) Flush() { switch c := j.container.(type) { case *vector.Vector: index := j.index.(int) - c.Set(index, j.Data()) + c.Set(index, j.Copy()) case map[string]interface{}: index := j.index.(string) - c[index] = j.Data() + c[index] = j.Copy() } } // Get the value built by this builder. -func (j *decoder) Data() interface{} { +func (j *decoder) Copy() interface{} { switch v := j.value.(type) { case *vector.Vector: - return v.Data() + return v.Copy() } return j.value }