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
VersionString() API selftest #139
VersionString() API selftest #139
Conversation
22e9bd0
to
d992a04
Compare
selftest/version/main.go
Outdated
@@ -0,0 +1,28 @@ | |||
package main | |||
|
|||
import "C" |
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.
we dont need import C here.
selftest/version/main.go
Outdated
|
||
// libbpf doesn't put the patch version in exported version | ||
// symbols, so use just prefix to exclude it | ||
if strings.HasPrefix(libbpfgo.VersionString(), string(b)) { |
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.
When I first read libbpfgo.VersionString() I thought we were comparing libbpf version with libbpfgo version (to see if libbpf string was contained in libbpfgo string). Should we change "VersionString" name ?
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.
Sure!
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 but I would remove the unneeded import and think about changing the version function name (it looks like we are giving libbpfgo version string and not libbpf one).
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
2fe4c81
d992a04
to
2fe4c81
Compare
Done! |
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
FAQ
Is this the most useful selftest? No.
Is it good to have? ok.
Signed-off-by: grantseltzer grantseltzer@gmail.com