-
Notifications
You must be signed in to change notification settings - Fork 64
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
pkg/pwalk: deprecate in favor of pkg/pwalkdir #185
Conversation
@kolyshkin @mrunalp @rhatdan PTAL |
pkg/pwalk/pwalk.go
Outdated
return walkN(root, walkFn, num) | ||
} | ||
|
||
func walkN(root string, walkFn WalkFunc, num int) error { |
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 is the meaning of this change? Is that for one deprecated function to not use another? In this case perhaps it's easier to annotate instead.
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.
Yeah, both my IDE and linter were complaining about using deprecated functions; so could've either added a //nolint:<xxx>
flag, or do this.
I'm wondering though if we perhaps should immediately proceed with aliasing this to the new package, if we're going to support go1.16+ (#183), WDYT?
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.
I changed this back.
w.r.t. aliasing; we can't alias it as the signatures don't match, so let's deprecate it as step 1, then remove after
80fdf9e
to
5b239e6
Compare
@kolyshkin updated; PTAL |
LGTM |
@rhatdan you need to use GitHub's "approve" now (we're no longer using pullapprove on this repo 😁) |
/approve |
The package was already deprecated in the README, but not in code. This patch marks the code as deprecated, as go1.15 reached EOL, so all consumers should be able to use the new package. In a follow-up, we remove it (after it's been in a release to allow users to migrate). Signed-off-by: Sebastiaan van Stijn <[email protected]>
5b239e6
to
de26d39
Compare
@kolyshkin @giuseppe PTAL |
@@ -29,6 +33,8 @@ type WalkFunc = filepath.WalkFunc | |||
// - if more than one walkFn instance will return an error, only one | |||
// of such errors will be propagated and returned by Walk, others | |||
// will be silently discarded. | |||
// | |||
// Deprecated: use [github.com/opencontainers/selinux/pkg/pwalkdir.Walk] |
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.
Kudos for using doc links!
Nit: missing period at EOL.
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.
Let me try it again locally, but I think there may have been a bug in Golang's parser; the doc links only work when surrounded by whitespace (to prevent map[string]string
being seen as a link), but that also meant that adding a period at the end cause it not to be seen as a link 😞
(Haven't filed an issue for it yet, but did for another one; golang/go#56072)
@@ -38,6 +44,8 @@ func Walk(root string, walkFn WalkFunc) error { | |||
// num walkFn will be called at any one time. | |||
// | |||
// Please see Walk documentation for caveats of using this function. | |||
// | |||
// Deprecated: use [github.com/opencontainers/selinux/pkg/pwalkdir.WalkN] |
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.
Nit: missing period at EOL.
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.
A couple of nits, but since this package is to be removed soon anyway, it doesn't matter much.
LGTM
The package was already deprecated in the README, but not in code. This patch marks the code as deprecated, as go1.15 reached EOL, so all consumers should be able to use the new package.
In a follow-up, we can make these functions an alias for the new package (or remove it altogether).