-
Notifications
You must be signed in to change notification settings - Fork 246
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/parsers/kernel: simplify #1889
Conversation
LGTM |
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.
Simplifying the Unix implementation, sure.
WRT removing the public Utsname
symbol, c/storage is supposed to have a stable API, but with things like #1622 (and many others), that’s… not been consistently the case.
As I was not able to find any existing users of |
Since golang.org/x/sys/unix provides portable way to use uname(2) syscall, let's use it for all unix variants, removing the duplicated code from uname_*.go. While at it: - remove uname_unsupported*.go (not used); - use unix.ByteSliceToString. NOTE this also removes the public definition of struct Utsname. I am puzzled as to why it was exported as it is not (and was not) used by any public functions in this package, nor I was able to find any usage of kernel.Utsname (using sourcegraph). Signed-off-by: Kir Kolyshkin <[email protected]>
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe, kolyshkin, rhatdan, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Since golang.org/x/sys/unix provides portable way to use uname(2) syscall, let's use it for all unix variants, removing the duplicated code from uname_*.go.
While at it:
NOTE this also removes the public definition of struct Utsname. I am puzzled as to why it was exported as it is not (and was not) used by any public functions in this package, nor I was able to find any usage of kernel.Utsname (using sourcegraph).