Skip to content

Commit

Permalink
Add example
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Korczynski <adam@adalogics.com>
  • Loading branch information
AdamKorcz committed Jan 14, 2024
1 parent 589154b commit 70a3dc6
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions probes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,26 @@ f = f.WithRemediationMetadata(map[string]string{
})
```

### Example
Consider a probe with following line in its `def.yml`:
```
The project ${{ metadata.oss-fuzz-integration-status }} integrated into OSS-Fuzz
```

and the probe sets the following metadata:
```golang
f, err := finding.NewWith(fs, Probe,
"Message", nil,
finding.OutcomePositive)
f = f.WithRemediationMetadata(map[string]string{
"oss-fuzz-integration-status": "is",
})
```

The probe will then output the following text:
```
The project is integrated into OSS-Fuzz.
```

### Should the changes be in the probe or the evaluation?
The remediation data must be set in the probe.

0 comments on commit 70a3dc6

Please sign in to comment.