Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

procstats: Remove the eq method from CPUTime #5

Merged
merged 1 commit into from
Dec 20, 2019
Merged

Conversation

dfinkel
Copy link
Collaborator

@dfinkel dfinkel commented Dec 19, 2019

The eq method was unexported and as such was only used in tests. Given
that we exposed other operator-like methods it was a bit of an anomaly
in being unexported.

To make it doubly weird, the default-generated == operator does
exactly what one would expect for the concrete type, so there's no
need for an eq method. Just rip it out and udpate the 3 tests that
used it.

Fun fact: some of the call-sites required adding parenthesis because otherwise the Go parser gets upset when it sees a pair of braces and then sees the open-brace for the body of the if statement.

The `eq` method was unexported and as such was only used in tests. Given
that we exposed other operator-like methods it was a bit of an anomaly
in being unexported.

To make it doubly weird, the default-generated `==` operator does
exactly what one would expect for the concrete type, so there's *no*
need for an `eq` method. Just rip it out and udpate the 3 tests that
used it.
@dfinkel dfinkel merged commit 13aed26 into master Dec 20, 2019
@dfinkel dfinkel deleted the cputime_no_eq branch December 20, 2019 21:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants