oduwsdl / MemGator

A Memento Aggregator CLI and Server in Go
https://memgator.cs.odu.edu/api.html
MIT License
55 stars 11 forks source link

main.go does not pass lint test #54

Closed machawk1 closed 8 years ago

machawk1 commented 8 years ago

Largely an issue of style but until we have some CI system setup for the repo, we ought to at least align with convention per https://github.com/golang/lint.

machawk1 commented 8 years ago

@ibnesayeed The *Archives is akin to a pointer (Go probably has its own name for it) but the Linter complains. Suggestions on remedying this?

ibnesayeed commented 8 years ago

I was not too much into linting it as the code really need some serious refactoring. Let me have a look at whats the complain about the *Archive thing and then I will see what can be done about it.

ibnesayeed commented 8 years ago

I don't see it being names something else anywhere else or I am failing to understand the suggestion by the linter well.

ibnesayeed commented 8 years ago

I don't see anything wrong according to the Receiver Names code review comments.

machawk1 commented 8 years ago
Be consistent, too: if you call the receiver "c" in one method, don't call it "cl" in another.

Maybe the linter is having issues with: func (slice Archives) vs func (a *Archives)

ibnesayeed commented 8 years ago

Yes, you were right, that was the issue. I have fixed and pushed the code. I would encourage you to make a pull request of your other changes in 11503d3 as well.

machawk1 commented 8 years ago

I merged 11503d3bc58fc4ca8ce1cb2e6685f8ae8a7b66ee but need to re-validate the lint before closing this issue.

machawk1 commented 8 years ago

That fixed the Receiver issue, @ibnesayeed , but the comment issues still need to be resolved to close this ticket.

ibnesayeed commented 8 years ago

Yes, we will keep this issue open. Investing of comments only makes sense after doing some refactoring. There is no point on adding comments just to pass the lint that might changes latter. I came to know something about the function arguments little late that I would like to do when refactoring. Which might actually change the function signatures, but would make them more compact.