Open eest opened 6 years ago
I feel lint errors like "exported method NetworkViewLock.Lock should have comment or be unexported" are bit silly. Many of the times methods/functions are self explanatory. Adding comments dont really add any value at times. just my view.
I understand what you mean. I bring it up because I feel it is helpful to have golint in my pre-commit checklist in order to more easily catch code that does not look like idiomatic Go before sending patches.
Agreed we should make go-lint happy.
Agreed also!
Additional reasons: 1) Sometimes even it might look self explanatory to the coder, there is typically details that might not be so obvious for a new comer to the code - these details should be included in those comments.
2) Note that godoc uses those comments to generate documentation.
3) Consistency is a good thing.
I have gone through the golint output and opened PRs for all the internal stuff that can be modified without thinking about external dependencies. I have also documented the external Logout method that I was responsible for adding.
I do not plan on touching any of the exported functions/methods/struct fields since this breaks the current contract with library users and therefore requires a higher level of coordination. I also think that documentation for exported functions is better handled by the function authors instead of me doing more or less qualified guesswork.
I noticed that running golint (https://github.com/golang/lint) will output a bunch of suggestions against master. Most of them are related to missing documentation comments for exported functions, but also some letter case fixes and code construct suggestions. I am opening an issue instead of a PR because it is unclear to me how these things should be handled and I am not in a good position to document the package.
Output: