Skip to content
This repository has been archived by the owner on Dec 15, 2019. It is now read-only.

Implements case where a map in ReadMap contains arrays. #16

Merged
merged 1 commit into from
May 23, 2014

Conversation

aybabtme
Copy link
Contributor

I was trying to read map[string]interface{} in fatherhood and had the bad surprise of a panic: Not supported yet =). I saw the ReadMap method on scanner was not able to read arrays, so I fixed that.

I've added a ReadSlice method on the Scanner interface, for consistency.

Would this make megajson support arrays of any types?

r: @benbjohnson

@@ -26,6 +26,7 @@ type Scanner interface {
ReadFloat64(target *float64) error
ReadBool(target *bool) error
ReadMap(target *map[string]interface{}) error
ReadSlice(target *[]interface{}) error
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aybabtme Can you change the name to ReadArray()? The interface is meant to describe the actions from the JSON point-of-view so the terminology would be "array".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'-.- called it like that at first

@benbjohnson
Copy link
Owner

@aybabtme other than the naming nit, lgtm.

@aybabtme
Copy link
Contributor Author

Changed it to ReadArray.

benbjohnson added a commit that referenced this pull request May 23, 2014
Implements case where a map in ReadMap contains arrays.
@benbjohnson benbjohnson merged commit 6966f50 into benbjohnson:master May 23, 2014
@aybabtme aybabtme deleted the readmap-with-arrays branch September 30, 2014 03:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants