diff --git a/cmd/all.go b/cmd/all.go index 9ac0213..4dc5a9e 100644 --- a/cmd/all.go +++ b/cmd/all.go @@ -34,6 +34,9 @@ func init() { } func allRun(hostString string, portString string, log bool, runtime int, noping bool) { + defer func() { + fmt.Println("[Yasso] scan task is completed") + }() var ( ips []string ports []int @@ -124,5 +127,4 @@ func allRun(hostString string, portString string, log bool, runtime int, noping fmt.Println("----- [Yasso] Start do web service scan -----") DisMapScan(alive, webports) } - fmt.Println("[Yasso] scan task is completed") } diff --git a/cmd/logger.go b/cmd/logger.go index 4076b3c..640a965 100644 --- a/cmd/logger.go +++ b/cmd/logger.go @@ -15,7 +15,7 @@ func Println(s string) { fmt.Println("[!] open log file failed", err) return } - file.WriteString("\n" + s) + _, _ = file.WriteString("\n" + s) } func CreateLogFile(filename string) { diff --git a/main.go b/main.go index 056beeb..ac4d2a7 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ import ( ) func init() { - cmd.CreateLogFile("result.txt") + cmd.CreateLogFile("Yasso.log") } func main() {