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

Switch the return sign of week.Sub to be consistent with time.Sub #11

Merged
merged 1 commit into from
Jun 28, 2018

Conversation

xkizer
Copy link
Contributor

@xkizer xkizer commented Jun 28, 2018

No description provided.

@coveralls
Copy link

coveralls commented Jun 28, 2018

Coverage Status

Coverage remained the same at 97.887% when pulling 747a19d on xkizer:ZSB-465 into 50eaf79 on stoewer:master.

@xkizer
Copy link
Contributor Author

xkizer commented Jun 28, 2018

Fixes #12

@stoewer stoewer added the bug Something isn't working label Jun 28, 2018
@@ -86,11 +86,11 @@ func (w *Week) Add(weeks int) (Week, error) {
return New(year, week)
}

// Sub calculates the positive difference between w and u (u-w) in number of weeks
// Sub calculates the positive difference between w and u (w-u) in number of weeks
func (w *Week) Sub(u *Week) int {
Copy link
Owner

Choose a reason for hiding this comment

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

Conceptually Week represents a value type and therefore methods and functions should receive week values as non pointers. Making u a non pointer would make method more consistent with other methods.

@stoewer stoewer merged commit cbac083 into stoewer:master Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants