apcera/nats — pull request #12 by MarkyV (2012-12-05 01:21:13+00:00)
Title: Fixed Type-os and a followup question

Hello,

This is my fourth pull request on GitHub, so please do provide feedback if I'm doing anything wrong here, thanks.

My coworker has convinced me of the value of Go and I have been looking for a Go project to work on to learn the language as part of 24PullRequests and last night your project was the only one suggested. I don't think I can contribute much more than this though in a short amount of time as the code looks excellent and mature as it is. Also, I am willing to undo most of my changes if they seem too extreme to you.

I did notice that there were a few places I may be able to help and bookmarked the areas of interest in the code, but wanted to ask before making any changes to see if they will be OK. I believe that it is always a good idea to have a default statement for switches and to be clear in error messages (both while testing and arg checking) why a particular test condition or argument to a method was invalid (as in, what value was expected and what was received). I was also thinking that there are a few magic numbers in the code and it might be a good idea to make them constants that show up toward the beginning of the class, but that may be a Java-line of thinking and I'm not sure if that's expected for Go code. One final thing is inspired by Google Guava and [is explained more here](https://code.google.com/p/guava-libraries/wiki/UsingAndAvoidingNullExplained), but I was thinking it might be nice to add validation to all methods that no nil arguments are received. I am not even sure if that's appropriate for a Go project yet, but if it is, I think that's something I can followup and do. Those are the additions I would like to make and was wondering if they would be welcome or appropriate for this project. Please let me know what you think and I'll follow up with another pull request if it seems like they will help out.

Thank you!