Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Remove unused internal or unexported functions #3481
base: master
Are you sure you want to change the base?
Remove unused internal or unexported functions #3481
Changes from 1 commit
b9aa09e
1ca826e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These may be actually occasionally useful for profiling?
BTW I didn't even know about the existence of this
internal/util/profile.go
until now (and I find it rather nice). (And BTW also I didn't know about the existence of thememusage
command.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not a big deal to write two lines when we need to profile something. For now, I propose removing redundant code that is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What exactly would we achieve by removing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing unnecessary functions will allow refactoring the
util
package into something more meaningful with a better name.The package name
util
is considered a bad package name according to https://go.dev/blog/package-names#bad-package-names.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like what?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's the usual ideal world example which would have been nice in the moment it has been respected from the beginning. But unfortunately the world isn't ideal, it hasn't been considered from the beginning and thus
util
is grown historically by throwing everything into it which doesn't fit into the other base packages.I wouldn't say that we're against such a cleanup process, but currently we've bigger construction sites at other places.
As said by @dmaluka or at least how I interpret it:
If you have a much better suggestion, please go ahead.
But remember, especially with the
lua.go
inutil
we most probably face problems withplugin
interfaces.