Skip to content

Instantly share code, notes, and snippets.

@bhuber
Created February 22, 2025 06:10
Show Gist options
  • Save bhuber/cbf4a366fb63a6689bfb15619d637132 to your computer and use it in GitHub Desktop.
Save bhuber/cbf4a366fb63a6689bfb15619d637132 to your computer and use it in GitHub Desktop.
diff --git a/README.md b/README.md
index 464876d..763f61c 100644
--- a/README.md
+++ b/README.md
@@ -67,13 +67,13 @@ GOFAIL_FAILPOINTS='failpoint1=return("hello");failpoint2=sleep(10)' ./cmd
### HTTP endpoint
-First, enable the HTTP server from the command line,
+First, enable the HTTP server from the command line:
```sh
GOFAIL_HTTP="127.0.0.1:1234" ./cmd
```
-Activate a single failpoint with curl,
+Activate a single failpoint with curl:
```sh
$ curl http://127.0.0.1:1234/SomeFuncString -XPUT -d'return("hello")'
@@ -85,19 +85,25 @@ Activate multiple failpoints atomically with the special `/failpoints` endpoint.
$ curl http://127.0.0.1:1234/failpoints -XPUT -d'failpoint1=return("hello");failpoint2=sleep(10)'
```
-List the failpoints,
+List all failpoint configurations:
+
+```sh
+$ curl http://127.0.0.1:1234/
+```
+
+List a single failpoint configuration:
```sh
$ curl http://127.0.0.1:1234/SomeFuncString
```
-Retrieve the execution count of a failpoint,
+Retrieve the execution count of a failpoint:
```sh
$curl http://127.0.0.1:1234/SomeFuncString/count -XGET
```
-Deactivate a failpoint,
+Deactivate a failpoint:
```sh
$ curl http://127.0.0.1:1234/SomeFuncString -XDELETE
diff --git a/integration/server/failpoints/failpoints.go b/integration/server/failpoints/failpoints.go
index 33c2d16..1513860 100644
--- a/integration/server/failpoints/failpoints.go
+++ b/integration/server/failpoints/failpoints.go
@@ -1,5 +1,8 @@
package failpoints
+// Some failpoints to test with.
+// copied from examples/examples.go
+
func ExampleFunc() string {
// gofail: var ExampleString string
// return ExampleString
diff --git a/integration/server/go.mod b/integration/server/go.mod
index ffe25dc..a591e93 100644
--- a/integration/server/go.mod
+++ b/integration/server/go.mod
@@ -1,8 +1,8 @@
module go.etcd.io/gofail/integration/server
-go 1.22
+go 1.23
-toolchain go1.22.10
+toolchain go1.23.6
require github.com/stretchr/testify v1.10.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment