exp icon indicating copy to clipboard operation
exp copied to clipboard

A question about Dump

Open eggfly opened this issue 11 years ago • 4 comments

@cznic I use a array to creat a sub-array, and calle it's Dump function. It dumps all informations from root array.

eggfly avatar Feb 10 '14 08:02 eggfly

And also Enumerator of a sub-array, will generate a iterator from root. Just a question, Thanks~

eggfly avatar Feb 10 '14 08:02 eggfly

Assuming the subject is func (a *Array) Dump(w io.Writer) (err error): It should dump the Array (which can be a sub tree of any other array). I'm not sure what is meant by the term 'root array'. Please provide a small compilable example for me to see what output is generated and what is expected instead. It might be a bug.

I think the Enumerator method of the same object should return the same data set as Dump does, but, shame on me, it's not cleat from the documentation. I should improve it.

cznic avatar Feb 10 '14 09:02 cznic

array := db.Array("name") subArray := array.Array("sub")

// array.Dump() is as same as subArray.Dump()

eggfly avatar Feb 10 '14 09:02 eggfly

Thanks, now I understand clearly. I will investigate if that's intended (improve documentation) or if it's a bug (fix it).

cznic avatar Feb 10 '14 09:02 cznic