Update scan.go

This commit is contained in:
公明 2025-04-24 11:11:18 +08:00 committed by GitHub
parent d779c99462
commit dc8146ec3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,6 +26,7 @@ type Result struct {
Result string `json:"result"`
Reason string `json:"reason"`
Confidence string `json:"confidence"`
Timestamp string `json:"timestamp"`
}
// 扫描结果
@ -94,6 +95,7 @@ func scan() {
resultOutput.Result = scanR.Res
resultOutput.Reason = scanR.Reason
resultOutput.Confidence = scanR.Confidence
resultOutput.Timestamp = time.Now().Format("2006-01-02 15:04:05")
jsonData, err := json.Marshal(resultOutput)
if err != nil {
log.Fatalf("Error marshaling to JSON: %v", err)