diff --git a/example_test.go b/example_test.go index a866875..251f89c 100644 --- a/example_test.go +++ b/example_test.go @@ -31,6 +31,13 @@ func ExampleNfqueue_RegisterWithErrorFunc() { } defer nf.Close() + // Avoid receiving ENOBUFS errors. + if err := nf.SetOption(netlink.NoENOBUFS, true); err != nil { + fmt.Fprintf(os.Stderr, "failed to set netlink option %v: %v", + netlink.NoENOBUFS, err) + return + } + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel()