Skip to content

Conversation

tianxiaoliang
Copy link

No description provided.

@tysonstewart
Copy link
Contributor

@tianxiaoliang Thanks for the contribution! I'm trying to find some time to test it out so I can get it merged.

marshal.go Outdated
// the raw JSON for later parsing.
func (i *InstanceMetadata) UnmarshalJSON(b []byte) error {
i.Raw = b
// TODO(cq) could actually parse Raw here, and in a parallel UnmarshalXML as well.
Copy link
Contributor

Choose a reason for hiding this comment

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

Update the comment to note the only outstanding proposal: unmarshal the XML. You took care of the first proposal here.

@tianxiaoliang
Copy link
Author

Done

func (ins *Instance) SetMetadataString(key, value string) {
if ins.Metadata.parsed == nil {
ins.Metadata.parsed = map[string]interface{}{}
if ins.Metadata.Parsed == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that we can set entries in this field, "Parsed" doesn't match its use. "Parsed" implies that we only receive these values.

Again, consider renaming it to "Map", "Fields", "Values", or something similar.

@damtur
Copy link
Contributor

damtur commented Sep 27, 2016

@tianxiaoliang Would you like to address @seh comments here. I want this to be merged ;)

Please also make sure that tests are working after the change for JSON.
Unfortunately I'm afraid that those might not work on master. They do for XML.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants