-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
base: master
Are you sure you want to change the base?
Conversation
host_test.go
Outdated
@@ -107,9 +117,7 @@ func TestHostNameCollision(t *testing.T) { | |||
scanner := bufio.NewScanner(r) | |||
|
|||
// Consume the initial buffer | |||
scanner.Scan() |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Make sure it builds. :) I suggest using go integration with your editor, it'll do it automagically. |
No description provided.