MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / Output

Function Output

tools/owl/scan/scanner.go:262–278  ·  view source on GitHub ↗

Output send the specified content to the console or file

(out string, scanner *Scanner, res []*Result)

Source from the content-addressed store, hash-verified

260
261// Output send the specified content to the console or file
262func Output(out string, scanner *Scanner, res []*Result) {
263 if out != "" {
264 if file, err := os.OpenFile(out, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0666); err != nil {
265 log.Warn(err)
266 file.Close()
267 os.Exit(1)
268 } else {
269 defer file.Close()
270 if err := scanner.Output(file, res); err != nil {
271 log.Warn(err)
272 os.Exit(1)
273 }
274 log.Info("The result has been redirected to: ", out)
275 os.Exit(0)
276 }
277 }
278}
279
280// OutFileString output content to the specified file
281func OutFileString(out string, _ *Scanner, hexStr string) {

Callers

nothing calls this directly

Calls 1

OutputMethod · 0.80

Tested by

no test coverage detected