Skip to content

procstats: Remove the eq method from CPUTime#5

Merged
dfinkel merged 1 commit intomasterfrom
cputime_no_eq
Dec 20, 2019
Merged

procstats: Remove the eq method from CPUTime#5
dfinkel merged 1 commit intomasterfrom
cputime_no_eq

Conversation

@dfinkel
Copy link
Contributor

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants