Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RowMap to go along with ColumnMap #18

Merged
merged 3 commits into from
Apr 21, 2015
Merged

Add RowMap to go along with ColumnMap #18

merged 3 commits into from
Apr 21, 2015

Conversation

zombor
Copy link
Contributor

@zombor zombor commented Apr 20, 2015

No description provided.

for i, key := range header {
result[key] = row[i]
}
}

Choose a reason for hiding this comment

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

Is this going to work for when you have more than one row in the table? it seems like result[key] is going to keep getting overwritten until the last row?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. RowMap should return a []map[string]string instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would something named Map to return a single map.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in 21426ed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open to suggestions on a new name.

@@ -38,6 +38,23 @@ func ColumnMap(table Table) map[string]string {
return result
}

func RowMap(table Table) []map[string]string {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this be plural; RowMaps or maybe MapRows...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in de0aa80.

@actualizeself
Copy link

🚵

zombor added a commit that referenced this pull request Apr 21, 2015
Add RowMap to go along with ColumnMap
@zombor zombor merged commit 5bd6df1 into master Apr 21, 2015
@zombor zombor deleted the row-map branch April 21, 2015 14:38
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.

3 participants