Skip to content

Commit

Permalink
Add SetOption to example
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Lehner <[email protected]>
  • Loading branch information
florianl committed Apr 27, 2024
1 parent 037c0e3 commit 8ceb7ef
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ func ExampleNfqueue_RegisterWithErrorFunc() {
}
defer nf.Close()

// Avoid receiving ENOBUFS errors.
if err := nf.SetOption(netlink.NoENOBUFS, true); err != nil {

Check failure on line 35 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.14.x, ubuntu-latest)

undefined: netlink

Check failure on line 35 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

undefined: netlink

Check failure on line 35 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest)

undefined: netlink

Check failure on line 35 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.x, ubuntu-latest)

undefined: netlink
fmt.Fprintf(os.Stderr, "failed to set netlink option %v: %v",

Check failure on line 36 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.14.x, ubuntu-latest)

undefined: os

Check failure on line 36 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

undefined: os

Check failure on line 36 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest)

undefined: os

Check failure on line 36 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.x, ubuntu-latest)

undefined: os
netlink.NoENOBUFS, err)

Check failure on line 37 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.14.x, ubuntu-latest)

undefined: netlink

Check failure on line 37 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.20.x, ubuntu-latest)

undefined: netlink

Check failure on line 37 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.21.x, ubuntu-latest)

undefined: netlink

Check failure on line 37 in example_test.go

View workflow job for this annotation

GitHub Actions / test (1.22.x, ubuntu-latest)

undefined: netlink
return
}

ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()

Expand Down

0 comments on commit 8ceb7ef

Please sign in to comment.