-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathprocessResults.go
47 lines (41 loc) · 1.11 KB
/
processResults.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"encoding/json"
"fmt"
"log"
)
// Issue represents an individual issue within the Results structure
type Issue struct {
IssueTitle string `json:"IssueTitle"`
URL string `json:"URL"`
AdditionalContext string `json:"AdditionalContext"`
}
// Result represents each result item in the Results array
type genzaiResult struct {
Target string `json:"Target"`
IoTidentified string `json:"IoTidentified"`
Category string `json:"category"`
Issues []Issue `json:"Issues"`
}
// Response represents the overall structure of the JSON
type Response struct {
Results []genzaiResult `json:"Results"`
Targets []string `json:"Targets"`
}
var genzaiOutput Response
func generateOutput() {
genzaiJson, err := json.MarshalIndent(genzaiOutput, "", " ")
if err != nil {
log.Println(genzaiOutput)
log.Println(err)
} else {
if saveOutput == "" {
fmt.Println("")
log.Println("No file name detected to log the output. Skipping to printing it!")
} else {
logData(string(genzaiJson), saveOutput)
}
fmt.Println("\n ")
fmt.Println(string(genzaiJson))
}
}