kubernetes/vendor/github.com/cilium/ebpf/feature.go
Odin Ugedal 5ba2a8da09
Pin dependency github.com/cilium/ebpf
Use same as opencontainers/runc
2020-01-24 13:13:44 +01:00

20 lines
217 B
Go

package ebpf
import (
"sync"
)
type featureTest struct {
Fn func() bool
once sync.Once
result bool
}
func (ft *featureTest) Result() bool {
ft.once.Do(func() {
ft.result = ft.Fn()
})
return ft.result
}