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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving the code and fixing some bugs #1

Merged
merged 3 commits into from
Jul 20, 2016

Conversation

campoy
Copy link
Contributor

@campoy campoy commented Jul 20, 2016

You had data races 馃槃
The order of columns and headers did not match
Too many files for what it is, I think now is more readable

I'll use this code in a video where I show how I improved it, if you don't mind!

@philipithomas
Copy link
Owner

philipithomas commented Jul 20, 2016

Thanks! Can you explain how the race would have worked? I didn't see any errors with the -race flag on the build (but I know that's not a panacea)

// Use waitgroup so we can keep track of tasks
columns := []string{*name, *address, *phone, *email}
headers := []string{"name", "address", "phone", "email"}
// url and id are added as the first two rows.
Copy link
Owner

@philipithomas philipithomas Jul 20, 2016

Choose a reason for hiding this comment

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

s/rows/columns

Copy link
Owner

Choose a reason for hiding this comment

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

(fixed on master)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would call it columns, because those are the column names ... but it's really up to you

@philipithomas
Copy link
Owner

I really like the way the Scrape function was rewritten.

@philipithomas philipithomas merged commit 79fe516 into philipithomas:master Jul 20, 2016
@campoy
Copy link
Contributor Author

campoy commented Jul 20, 2016

There was no data race, sorry. But you were leaking go routines, which didn't have any effect on your binary since it's short lived
The same code as a package would leak go routines, therefore memory

@campoy
Copy link
Contributor Author

campoy commented Jul 20, 2016

So would you mind if I made a video of me reviewing this code and posted it on YouTube? 馃檹

@philipithomas
Copy link
Owner

Yes @campoy - go for it! I sent you an email about it too.

Repository owner locked and limited conversation to collaborators Jul 22, 2016
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