Skip to content

Commit 80c9014

Browse files
chore: update README with UploadAndAnalyze refactoring details
1 parent ca2c622 commit 80c9014

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ Implement the `config.Config` interface to configure the Snyk Code API client fr
8686

8787
Use the Code Scanner to trigger a scan for a Snyk Code workspace using the Bundle Manager created above.
8888

89-
The Code Scanner exposes a `UploadAndAnalyze` function, which can be used like this:
89+
The Code Scanner exposes two scanning functions: `UploadAndAnalyze` (which supports Code Consistent Ignores) and
90+
`UploadAndAnalyzeLegacy`. These functions may be used like this:
9091

9192
```go
9293
import (
@@ -102,7 +103,12 @@ codeScanner := codeClient.NewCodeScanner(
102103
codeClientHTTP.WithInstrumentor(instrumentor),
103104
codeClientHTTP.WithErrorReporter(errorReporter),
104105
)
105-
codeScanner.UploadAndAnalyze(context.Background(), requestId, target, channelForWalkingFiles, changedFiles)
106+
if useCodeConsistentIgnores() {
107+
codeScanner.UploadAndAnalyze(context.Background(), requestId, target, channelForWalkingFiles, changedFiles)
108+
} else {
109+
codeScanner.UploadAndAnalyzeLegacy(context.Background(), requestId, target, shardKey, files, changedFiles, statusChannel)
110+
}
111+
106112
```
107113

108114

0 commit comments

Comments
 (0)