We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0bf6a29 commit da5e6f7Copy full SHA for da5e6f7
btf/feature.go
@@ -15,13 +15,14 @@ import (
15
var haveBTF = internal.NewFeatureTest("BTF", func() error {
16
// 0-length anonymous integer
17
err := probeBTF(&Int{})
18
- if errors.Is(err, unix.EINVAL) {
+ switch {
19
+ case errors.Is(err, unix.EINVAL):
20
return internal.ErrNotSupported
- }
21
- if errors.Is(err, unix.EPERM) {
+ case errors.Is(err, unix.EPERM):
22
return fmt.Errorf("%w: %w", internal.ErrNotPermitted, err)
23
+ default:
24
+ return err
25
}
- return err
26
}, "4.18")
27
28
// haveMapBTF attempts to load a minimal BTF blob containing a Var. It is
0 commit comments