Closed dolmen closed 4 months ago
@brackendawson There is no significant performance improvement (or degradation) expected. The resource usage I claim is just the absence of the type definition in the final binary, so a smaller binary.
Compare the output of this command on this branch vs master
:
$ (cd assert ; go test -c && strings assert.test | grep BoolAssertionFunc)
Summary
The tHelper interface is defined only for internal usage. We don't need a "hard" type for it as we don't define methods on it. Let's make is just a alias to the anonymous interface it represents.
Note: we are already using type aliases elswhere, and type aliases were introduced a long time ago in Go 1.9.
Changes
tHelper
becomes a type aliastHelper
becomes a type aliasMotivation
The
tHelper
symbol is not needed at runtime. This should reduce resource usage (yes, negligible).Related issues
1422 is also related to the
interface { Helper() }
type, but not dependent