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 tests for the /motd command #189

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

erwanor
Copy link

@erwanor erwanor commented Aug 6, 2016

No description provided.

host_test.go Outdated
@@ -107,9 +117,7 @@ func TestHostNameCollision(t *testing.T) {
scanner := bufio.NewScanner(r)

// Consume the initial buffer
scanner.Scan()
Copy link
Owner

@shazow shazow Aug 6, 2016

Choose a reason for hiding this comment

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

-0.5 on this change, not worth it unless we're doing this for large N (like >5). More clear to avoid the extra indirection otherwise.

Copy link
Author

Choose a reason for hiding this comment

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

I think there are only one case where N>5 (:> N=8) - do you think it is worth keeping the function then? The eight calls to scanner.Scan() aren't "pretty" but at least there is one way to do it (decrease the cognitive cost of figuring out what is going on). Wdyt?

Copy link
Owner

Choose a reason for hiding this comment

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

Ah fair enough, let's hang onto it for now.

@shazow
Copy link
Owner

shazow commented Aug 12, 2016

Make sure it builds. :) I suggest using go integration with your editor, it'll do it automagically.

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.

2 participants