Is there any demo or userguide for failpoint?
Open
Nobody has claimed this yet.
question
- Dominant language
- Go
- Stars
- 895
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
I cannot have any idea that how to use failpoint. I tried write demo like this:
var outerVar = "declare in outer scope"
err := failpoint.Enable("failpoint-name", "return")
if err != nil {
fmt.Println(err)
return
}
failpoint.Inject("failpoint-name", func(val failpoint.Value) {
fmt.Println("unit-test", val, outerVar)
})
There isn't have any output. How could I use it in the right way?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Go snippet in the issue and inspect the repository's existing failpoint usage to determine why it produces no output. Add a focused demo or user guide showing the correct usage and the expected output, so a reader can verify the example works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100